Fix a potential bug in file cropper