Updated getImageName to select image with most appropriate ratio.