title: magento delete additional images
body: <pre><code>&lt;?php
  require 'app/Mage.php';
  Mage::app();
  $products = Mage::getModel('catalog/product')-&gt;getCollection()
                                          -&gt;addAttributeToSelect('id')
                                          -&gt;addAttributeToSelect('image')
                                          -&gt;addAttributeToSelect('small_image')
                                          -&gt;addAttributeToSelect('thumbnail_image');
  foreach ($products as $product) {
    if (!$product-&gt;hasImage()) continue;
    if (!$product-&gt;hasSmallImage()) $product-&gt;setSmallImage($product-&gt;getImage());
    if (!$product-&gt;hasThumbnail()) $product-&gt;setThumbnail($product-&gt;getImage());
    $product-&gt;save();
  }
  </code></pre>
  
  <p>I am trying to figure out how to delete additional images with this code, but I don't see a guide anywhere on the net :(  I used this code to set small, thumbnail to the base image, and now I am stuck trying to remove the duplicate additional images.</p>