Show category images on single product page and product overview page

I had the same problem and I came up with this solution, hope it helps.

<?php
    $terms = get_the_terms( $post->ID, 'product_cat' );
    foreach ( $terms as $term ){
        $category_name = $term->name;
        $category_thumbnail = get_woocommerce_term_meta($term->term_id, 'thumbnail_id', true);
        $image = wp_get_attachment_url($category_thumbnail);
        echo '<img src="'.$image.'">';
    }
?>