Index: includes/theme.inc
===================================================================
RCS file: /cvs/drupal/drupal/includes/theme.inc,v
retrieving revision 1.507
diff -u -r1.507 theme.inc
--- includes/theme.inc	20 Aug 2009 15:18:09 -0000	1.507
+++ includes/theme.inc	21 Aug 2009 15:06:09 -0000
@@ -1461,7 +1461,7 @@
   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 . ' />';
+    return '<img src="' . check_url($url) . '" alt="' . check_plain($alt) . '" title="' . check_plain($title) . '"' . (isset($image_attributes) ? ' ' . $image_attributes : '') . (!empty($attributes) ? ' ' . $attributes : '') . ' />';
   }
 }
 
