Give images a max-height instead of max-width, so we can calcuate scrollHeight immediately