title: Magento2 get product images externally
body: <p>I have a external script i use to fetch the current quote products (as external cart for example) This works perfect.</p>
  
  <p>In this code i use the following:</p>
  
  <pre><code>$quote = $obj-&gt;get('Magento\Checkout\Model\Session')-&gt;getQuote();
  $helper = $obj-&gt;get('\Magento\Checkout\Helper\Cart');
  $quote = $helper-&gt;getQuote();
  $quoteitems = $quote-&gt;getAllItems();
  $cart= $helper-&gt;getCart();  
  foreach ($quoteitems as $item)
  {
      $_imagehelper = $obj-&gt;get('\Magento\Catalog\Helper\Image');
      $product = $item-&gt;getProduct();
      $img = $_imagehelper-&gt;init($product,'category_page_list',array('height' =&gt; '100' , 'width'=&gt; '100'))-&gt;getUrl();
  }
  </code></pre>
  
  <p>This results in: /pub/static/frontend/_view/nl_NL/Magento_Catalog/images/product/placeholder/.jpg</p>
  
  <p>While in a layout block i use the following and that works perfect:</p>
  
  <pre><code>$helper = $this-&gt;helper('\Magento\Checkout\Helper\Cart');
  $quote = $helper-&gt;getQuote();
  $quoteitems = $quote-&gt;getAllItems();
  $cart= $helper-&gt;getCart();  
  foreach ($quoteitems as $item)
  {
      $_imagehelper = $this-&gt;helper('Magento\Catalog\Helper\Image');
      $product = $item-&gt;getProduct();
      $img = $_imagehelper-&gt;init($product,'category_page_list',array('height' =&gt; '100' , 'width'=&gt; '100'))-&gt;getUrl();
  }
  </code></pre>
  
  <p>Im out of ideas.</p>