Prevent page flicker due to img max-width/max-height