Fix a bug where cropping an image swaps the X and Y positions.  Fixes bug #12413