document.addEventListener("DOMContentLoaded", function () { const thumbs = document.querySelectorAll('.pt-cv-thumbnail'); thumbs.forEach(function (thumb) { const img = thumb.querySelector('img'); if (img.complete) { thumb.style.paddingTop = '0'; } else { img.addEventListener('load', function () { thumb.style.paddingTop = '0'; }); } }); });