Resize a image to a max width and height and keep aspect ratio.