Account for CSS zoom in images before resizing

The browser gives us the native image size even after it was scaled with CSS zoom. This meant that when the "relative image zoom" setting was used, the image was scaled twice: once by the zoom level and again by resize code.

This fix accounts for the zoom level before checking if the dimensions of the image exceed the window length. Image resizing is skipped if the zoom level already lowers the image dimensions below the window size.