Bug fix in the image scaling code.