Calculating and displaying correct ratio for images