title: Get product image url in prestashop 1.5.4
body: <p>I uploaded my product images as follow: an image with 1234 id will be uploaded in img/p/1/2/3/4/1234-large_default.jpg when i viewed the product information related to the image, a default file (product image unavailable) is displayed.</p>
  
  <p>my code for adding images to database </p>
  
  <pre><code>$res = "insert into "._DB_PREFIX_."image (`id_product`,`position`,`cover`) values 
  (".$id_product.",1, 1)";
  if (!Db::getInstance()-&gt;execute($res))
  die('Erreur etc.');
  $id_image = Db::getInstance()-&gt;Insert_ID();
  
  $res = "insert into "._DB_PREFIX_."image_lang (`id_image`,`id_lang`) values   (".$id_image.", 1)";
  if (!Db::getInstance()-&gt;execute($res))
  die('Erreur etc.');
  
  $res = "insert into "._DB_PREFIX_."image_lang (`id_image`,`id_lang`) values (".$id_image.", 2)";
  if (!Db::getInstance()-&gt;execute($res))
  die('Erreur etc.');
  
  $stmt = "insert into "._DB_PREFIX_."image_shop(`id_image`,`id_shop`,`cover`) values (".$id_image.",1,1)";
  $folders = str_split($id_image);
  $i = 0;
  $base_uri ='var/www/autospareparts.se.com/img/p/';
  $folders = str_split($id_image);
  $i = 0;
  $base_uri ='/var/www/autospareparts.se.com/img/p/';
  while( $i &lt;sizeof($folders) )
  {
  
  
  $base_uri .= $folders[$i].'/';
  
  
  if($i==(sizeof($folders) -1))
  {if(!is_dir( $base_uri))
  if(!mkdir($base_uri, 0777, true))
  die('Echec lors de la création des répertoires...');
  download_remote_file('http://pic1.aldoc.eu/PicData  /'.$pic,$base_uri.$id_image.'large_default.jpg' );
  
  }
  //fin else
  $i++;
  }
  </code></pre>
  
  <p>I showed the code of mytheme/product.tpl i found</p>
  
  <pre><code>$link-&gt;getImageLink($product-&gt;link_rewrite, $cover.id_image, 'large_default')
  </code></pre>
  
  <p>which return  img/p/fr-default-large_default.jpg</p>
  
  <p>Can you tell me what's wrong?
  Thanks</p>