fix image deleting bug