fix image deletion