title: Magento Only show products with image on home page
body: <p>I<code>m working with random products on my homepage and i</code>m trying to show only products with images and in stock. I managed to get it to show only products with image and instock by using the code below:</p>
  
  <pre><code>&lt;?php
   $products_noimage = Mage::getModel('catalog/product')
      -&gt;getCollection()
      -&gt;addAttributeToSelect('*')
      -&gt;addAttributeToFilter('image', array('neq' =&gt; 'no_selection'));     
   ?&gt;
  &lt;?php foreach ($_productCollection as $_product): ?&gt;
  &lt;?php  if(!$_product-&gt;isSaleable() &amp;&amp; $products_noimage &amp;&amp; $_product-&gt;isInStock())continue; ?&gt;
  &lt;?php //if criteria is meet show products below     
  ?&gt;
  </code></pre>
  
  <p>but my problem is when homepage is loaded sometimes it will show only 1 or 2 products in the grid since I have lots of products without image and outofstock I think the page is loading products outofstock and without image but showing only 1 or 2 products with image and in stocky.</p>
  
  <p>Example: the page will load 16 products in the grid from those 16 products only 2 have image and are instock the rest do not meet this criteria..</p>
  
  <p>How to avoid it and instead of loading only those 2 that meet the criteria load in sequence the others products that meed those criteria (with image and instock)..</p>
  
  <p>or maybe it will never work because i`m using the list.phtml block ?</p>
  
  <pre><code>{{block type="catalog/product_list_random"        template="catalog/product/productrandomhom.phtml"}}      
  </code></pre>
  
  <p>If anyone has a solution to filter random products on home page feel to share =)</p>