I'm having an issue whereby, when the page loads, images take a little bit of time to load in, which is not only ugly but breaks the functionality of a scroll-up button (which needs to be absolutely positioned at the bottom of the page once we've scrolled down to the bottom of the page - however, on page load, the images aren't taking any space, and thus the JS calculates the length of the page incorrectly). Normally you'd set a height and width directly on the image, but since the image dimensions change depending on the screen width, as demonstrated in the image above (on mobile, it's fluid, so I can't manually set a width/ height based on breakpoints), I'm unable to do it.
Might someone know of a solution that can set the height of the images depending upon their width?
Since people don't seem to get why I need to absolutely position my scroll button: https://i.gyazo.com/65629a7e2642e192165596755c5b408b.gif