Make resizing & cropping with PIL work

Previously it was trying to use undefined variables