move some CropImage methods into Util