fix image equality code