diff --git a/htdocs/core/class/conf.class.php b/htdocs/core/class/conf.class.php
index d7eaada15c3e7d55260b625a5ea5859f5f19d743..321e7a0e57722c1bff52f978fce9fbe59fe0a5fb 100644
--- a/htdocs/core/class/conf.class.php
+++ b/htdocs/core/class/conf.class.php
@@ -248,7 +248,9 @@ class Conf
 		$this->fournisseur->commande->dir_temp  =$rootfordata."/fournisseur/commande/temp";
 		$this->fournisseur->facture->dir_output =$rootfordata."/fournisseur/facture";
 		$this->fournisseur->facture->dir_temp   =$rootfordata."/fournisseur/facture/temp";
-		// Module service
+		// Module product/service
+		$this->product->dir_output=$rootfordata."/produit";
+		$this->product->dir_temp  =$rootfordata."/produit/temp";
 		$this->service->dir_output=$rootfordata."/produit";
 		$this->service->dir_temp  =$rootfordata."/produit/temp";
 		// Module contrat
diff --git a/htdocs/core/photos_resize.php b/htdocs/core/photos_resize.php
index 8a352b5221120d873d4a82cc869ad697260d2a31..fe1fdbce0dab96a9165eedb3c85b6bccabd69089 100644
--- a/htdocs/core/photos_resize.php
+++ b/htdocs/core/photos_resize.php
@@ -46,6 +46,7 @@ if ($_POST["action"] == 'confirm_resize' && (isset($_POST["file"]) != "") && (is
 {
 	$product=new Product($db);
 	$result=$product->fetch($_POST["id"]);
+	if ($result <= 0) dol_print_error($db,'Failed to load object');
 	$dir=$conf->product->dir_output;	// By default
 	if ($product->type == 0) $dir=$conf->product->dir_output;
 	if ($product->type == 1) $dir=$conf->service->dir_output;
@@ -55,7 +56,7 @@ if ($_POST["action"] == 'confirm_resize' && (isset($_POST["file"]) != "") && (is
 
 	if ($result == $fullpath)
 	{
-		header("Location: ".DOL_URL_ROOT."/product/photos.php?id=".$_POST["product"].'&action=addthumb&file='.urldecode($_POST["file"]));
+		header("Location: ".DOL_URL_ROOT."/product/photos.php?id=".$_POST["id"].'&action=addthumb&file='.urldecode($_POST["file"]));
 		exit;
 	}
 	else
@@ -71,6 +72,7 @@ if ($_POST["action"] == 'confirm_crop')
 {
 	$product=new Product($db);
 	$result=$product->fetch($_POST["id"]);
+	if ($result <= 0) dol_print_error($db,'Failed to load object');
 	$dir=$conf->product->dir_output;	// By default
 	if ($product->type == 0) $dir=$conf->product->dir_output;
 	if ($product->type == 1) $dir=$conf->service->dir_output;
@@ -80,7 +82,7 @@ if ($_POST["action"] == 'confirm_crop')
 
 	if ($result == $fullpath)
 	{
-		header("Location: ".DOL_URL_ROOT."/product/photos.php?id=".$_POST["product"].'&action=addthumb&file='.urldecode($_POST["file"]));
+		header("Location: ".DOL_URL_ROOT."/product/photos.php?id=".$_POST["id"].'&action=addthumb&file='.urldecode($_POST["file"]));
 		exit;
 	}
 	else
@@ -123,8 +125,8 @@ print $langs->trans("NewLength").': <input class="flat" name="sizex" size="10" t
 print $langs->trans("NewHeight").': <input class="flat" name="sizey" size="10" type="text" > px &nbsp; <br>';
 print '<input type="hidden" name="file" value="'.$_GET['file'].'" />';
 print '<input type="hidden" name="action" value="confirm_resize" />';
-print '<input type="hidden" name="product" value="'.$_GET['id'].'" />';
-print '<input type="hidden" name="id" value="'.$_GET['id'].'" />';
+print '<input type="hidden" name="product" value="'.$_REQUEST['id'].'" />';
+print '<input type="hidden" name="id" value="'.$_REQUEST['id'].'" />';
 print '<br><input class="button" name="sendit" value="'.dol_escape_htmltag($langs->trans("Resize")).'" type="submit" />';
 print '</fieldset>';
 print '<br></form>';
@@ -157,8 +159,8 @@ print '<form action="'.$_SERVER["PHP_SELF"].'?id='.$_GET['id'].'" method="post"
 
       <input type="hidden" id="file" name="file" value="'.urlencode($original_file).'" />
       <input type="hidden" id="action" name="action" value="confirm_crop" />
-      <input type="hidden" id="product" name="product" value="'.$_GET['id'].'" />
-	  <input type="hidden" name="id" value="'.$_GET['id'].'" />
+      <input type="hidden" id="product" name="product" value="'.$_REQUEST['id'].'" />
+	  <input type="hidden" name="id" value="'.$_REQUEST['id'].'" />
       <br><input type="submit" class="button" value="'.dol_escape_htmltag($langs->trans("Recenter")).'" />
    </form>';
 print '</fieldset>';
diff --git a/htdocs/product/photos.php b/htdocs/product/photos.php
index 89fb60e89684bc413ea808111eff7a9357495476..4e82ef8f1925fc7dcbbec22054478429c7574b14 100644
--- a/htdocs/product/photos.php
+++ b/htdocs/product/photos.php
@@ -46,6 +46,7 @@ $result=restrictedArea($user,'produit|service',$id,'product','','',$fieldid);
 $mesg = '';
 $dir = (!empty($conf->product->dir_output)?$conf->product->dir_output:$conf->service->dir_output);
 
+
 /*
  * Actions
  */