diff --git a/modules/image/image.field.inc b/modules/image/image.field.inc
index 6d1867c..5a265e0 100644
--- a/modules/image/image.field.inc
+++ b/modules/image/image.field.inc
@@ -406,16 +406,20 @@ function image_field_widget_process($element, &$form_state, $form) {
       '#markup' => theme('image_style', $variables),
     );
 
-    // Store the dimensions in the form so the file doesn't have to be accessed
-    // again. This is important for remote files.
-    $element['width'] = array(
-      '#type' => 'hidden',
-      '#value' => $variables['width'],
-    );
-    $element['height'] = array(
-      '#type' => 'hidden',
-      '#value' => $variables['height'],
-    );
+    // If we do not have a sensible value for height and width, we are not
+    // interested in storing these values.
+    if (!empty($variables['width']) && !empty($variables['height'])) {
+      // Store the dimensions in the form so the file doesn't have to be accessed
+      // again. This is important for remote files.
+      $element['width'] = array(
+        '#type' => 'hidden',
+        '#value' => $variables['width'],
+      );
+      $element['height'] = array(
+        '#type' => 'hidden',
+        '#value' => $variables['height'],
+      );
+    }
   }
 
   // Add the additional alt and title fields.
