title: Magento - Save only product media gallery
body: <p>I write a module which make auto translation of my content. I have a problem with the products images, I need to save only one field : media_gallery.</p>
  
  <p>This is what I do :</p>
  
  <pre><code>public function translateAltProducts($idProduct) {
  
      $bingModel      = Mage::getModel('autotranslation/bing');
      // For each foreign store
      $allStores = Mage::app()-&gt;getStores();
      foreach ($allStores as $_eachStoreId =&gt; $val) {
          $_storeId = Mage::app()-&gt;getStore($_eachStoreId)-&gt;getId();
          if($_storeId!=1) {
  
              // Load product
              $_product = Mage::getModel('catalog/product')-&gt;setStoreId($_storeId)-&gt;load($idProduct);
  
              // Get images
              $gallery = $_product-&gt;getData('media_gallery');
  
              // For each image
              foreach($gallery['images'] as &amp;$image) :
  
                  // Do translation
                  $translation = false;
                  $nbr = 0;
  
                  do {
                      $translation = $bingModel-&gt;translateTitle($image['label'], $this-&gt;fromLanguage, $_storeId);
                      if(++$nbr==3) die('erreur ' . $idProduct);
                  }
                  while($translation===false);
  
                  // If got translation
                  $image['label'] = $translation;
  
              endforeach;
  
              // Save translation
              $_product-&gt;addAttributeUpdate('media_gallery', $gallery, $_storeId);
  
          }
      }
  }
  </code></pre>
  
  <p>I usualy use "$_product->addAttributeUpdate()" to update a field alone but it don't work here.</p>
  
  <p>If I use $_product->setData('media_gallery', $gallery) &amp; $_product->save() it works but I lost all pre-filled fields with "Use Default Value".</p>
  
  <p>If you have any ideas...</p>
  
  <p>Thanks,</p>
  
  <p>Aurelien</p>