Fix pixel coordinate translation for rectangular images