my attempt for fix image crop bug