fix image matching and failure matching