Have a look at the addImageToMediaGallery function in app/code/core/Mage/Catalog/Model/Product.php:
/** * Add image to media gallery * * @param string $file file path of image in file system * @param string|array $mediaAttribute code of attribute with type 'media_image', * leave blank if image should be only in gallery * @param boolean $move if true, it will move source file * @param boolean $exclude mark image as disabled in product page view * @return Mage_Catalog_Model_Product */ public function addImageToMediaGallery($file, $mediaAttribute=null, $move=false, $exclude=true) { $attributes = $this->getTypeInstance(true)->getSetAttributes($this); if (!isset($attributes['media_gallery'])) { return $this; } $mediaGalleryAttribute = $attributes['media_gallery']; /* @var $mediaGalleryAttribute Mage_Catalog_Model_Resource_Eav_Attribute */ $mediaGalleryAttribute->getBackend()->addImage($this, $file, $mediaAttribute, $move, $exclude); return $this; }
You'll see there is another parameter which is a boolean to exclude the product from the small image preview, yet you're setting this boolean as False. The primary image should have this value set to 'true' to avoid duplicating the image. So give that a shot:
$this->product->addImageToMediaGallery( $tmpFile, array('image', 'thumbnail', 'small_image'), true);
Then you should be all set.