transformation.py: Fix cropping and centering of images.