Small fixes for image cropping; added more tests for cropping