Size calculation fixed

Image size must be calculated with the distance of the text from the top of the image in mind.