implement image cropping and resizing