diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php
index 1394ad46f2b..8ba38b81edb 100644
--- a/htdocs/core/class/html.form.class.php
+++ b/htdocs/core/class/html.form.class.php
@@ -6861,10 +6861,10 @@ class Form
$dir=$conf->user->dir_output;
if (! empty($object->photo))
{
- if ((string) $imagesize == 'mini') $file=get_exdir($id, 2, 0, 0, $object, 'user').$object->id.'/'.getImageFileNameForSize($object->photo, '_mini');
- else if ((string) $imagesize == 'small') $file=get_exdir($id, 2, 0, 0, $object, 'user').$object->id.'/'.getImageFileNameForSize($object->photo, '_small');
- else $file=get_exdir($id, 2, 0, 0, $object, 'user').'/'.$object->id.'/'.$object->photo;
- $originalfile=get_exdir($id, 2, 0, 0, $object, 'user').'/'.$object->id.'/'.$object->photo;
+ if ((string) $imagesize == 'mini') $file=get_exdir(0, 0, 0, 0, $object, 'user').$object->id.'/'.getImageFileNameForSize($object->photo, '_mini');
+ else if ((string) $imagesize == 'small') $file=get_exdir(0, 0, 0, 0, $object, 'user').$object->id.'/'.getImageFileNameForSize($object->photo, '_small');
+ else $file=get_exdir(0, 0, 0, 0, $object, 'user').'/'.$object->id.'/'.$object->photo;
+ $originalfile=get_exdir(0, 0, 0, 0, $object, 'user').'/'.$object->id.'/'.$object->photo;
}
if (! empty($conf->global->MAIN_OLD_IMAGE_LINKS)) $altfile=$object->id.".jpg"; // For backward compatibility
$email=$object->email;