Reproject x before calculating centroid.
Refine cropping code so output images match.