Sample custom.js:
$(document).ajaxStart(function() { var imgs = document.getElementsByTagName('img'); if (imgs){ for (var i = 0; i < imgs.length; i++) { var width = imgs[i].naturalWidth; var height = imgs[i].naturalHeight; imgs[i].setAttribute('width', width); imgs[i].setAttribute('height', height); } } });
You can put this code in the file:
./themes/your-theme/assets/js/custom.js
If such a file "custom.js" does not exist, create it.