fixed imgpos util so that when an image is small, it doesn't squish the image