Scale max dimension, not min dimension, to max_image_size.