Prevent a possible divide-by-zero error and a minor coordinate alignment issue near top left corner of the image.