diff --git a/product/ERP5/Document/Image.py b/product/ERP5/Document/Image.py
index f5eefb09c985f9d2a9c402c2f4fdbbe89799cbf8..fce1bf15a8b084e7a2a4b4ebeba9a1e53598a501 100644
--- a/product/ERP5/Document/Image.py
+++ b/product/ERP5/Document/Image.py
@@ -513,7 +513,7 @@ class Image(File, OFSImage):
       width_preference = 'preferred_%s_image_width' % (image_display,)
       height = preference_tool.getPreference(height_preference)
       width = preference_tool.getPreference(width_preference)
-      return (height, width)
+      return (width, height)
     return None
 
   def _setFile(self, *args, **kw):
diff --git a/product/ERP5Form/ImageField.py b/product/ERP5Form/ImageField.py
index a833f570b94fb705ca1c48a682a478471a2e452a..50f295f200792d8f11bcd568a5cfdd2723251791 100644
--- a/product/ERP5Form/ImageField.py
+++ b/product/ERP5Form/ImageField.py
@@ -149,7 +149,7 @@ class ImageFieldWidget(Widget.TextWidget):
 
       # set the size of the image
       if display is not None:
-        height, width = image_object.getSizeFromImageDisplay(display)
+        width, height = image_object.getSizeFromImageDisplay(display)
         width, height = image_object._getAspectRatioSize(width, height)
         if draw_frame_node.attrib.get('{%s}width' % SVG_URI, {}) != {} and \
         draw_frame_node.attrib.get('{%s}height' % SVG_URI, {}) != {}: