Index: includes/theme.inc
===================================================================
RCS file: /cvs/drupal/drupal/includes/theme.inc,v
retrieving revision 1.582
diff -u -p -r1.582 theme.inc
--- includes/theme.inc	4 Mar 2010 09:03:08 -0000	1.582
+++ includes/theme.inc	13 Mar 2010 20:13:35 -0000
@@ -1500,9 +1500,17 @@ function theme_image($variables) {
   $getsize = $variables['getsize'];
 
   if (!$getsize || (is_file($path) && (list($width, $height, $type, $image_attributes) = @getimagesize($path)))) {
-    $attributes = drupal_attributes($attributes);
-    $url = file_create_url($path);
-    return '<img src="' . check_url($url) . '" alt="' . check_plain($alt) . '" title="' . check_plain($title) . '" ' . (isset($image_attributes) ? $image_attributes : '') . $attributes . ' />';
+    $attributes['src'] = check_url(file_create_url($path));
+    if (!empty($alt)) {
+      $attributes['alt'] = check_plain($alt);
+    }
+    if (!empty($title)) {
+      $attributes['title'] = check_plain($title);
+    }
+    if (!empty($image_attributes)) {
+      $attributes += $image_attributes;
+    }
+    return '<img' . drupal_attributes($attributes) . ' />';
   }
 }
 
