fixes #3207 - correct check for maxXY for unscaled images

Thanks to @rsudev finding the problem. Just a simple fix.