title: woocomerce view order images not displayed when product deleted
body: <p>Hi I have built a site with woocomerce and to display the images of the products on the view order page I have added the following code in the functions.php file.  It works fine, however often time I need to delete some products and even though I dont delete the media (pictures), if I do that for a product that was ordered I get a fatal error on the view order page, as it is missing the product and the reference to the product and picture. Is there any way to display the images using some sort of reference only to the media and not the product to avoid this issue? any idea or suggestion.</p>
  <p>// Display the product thumbnail in order view pages
  add_filter( 'woocommerce_order_item_name', 'display_product_image_in_order_item', 20, 3 );
  function display_product_image_in_order_item( $item_name, $item, $is_visible ) {
  // Targeting view order pages only
  if( is_wc_endpoint_url( 'view-order' ) ) {
  $product       = $item-&gt;get_product(); // Get the WC_Product object (from order
  item)
  $product_image = $product-&gt;get_image(array( 36, 36)); // Get the product thumbnail
  (from product object)
  $item_name     = '' . $product_image . '' . $item_name;
  }
  return $item_name;
  }</p>