--- wordpress/wp-includes/media.php	2010-06-27 00:48:20.000000000 +0100
+++ wordpress/wp-includes/media.php	2010-06-27 01:51:36.000000000 +0100
@@ -79,32 +79,6 @@
 }
 
 /**
- * Retrieve width and height attributes using given width and height values.
- *
- * Both attributes are required in the sense that both parameters must have a
- * value, but are optional in that if you set them to false or null, then they
- * will not be added to the returned string.
- *
- * You can set the value using a string, but it will only take numeric values.
- * If you wish to put 'px' after the numbers, then it will be stripped out of
- * the return.
- *
- * @since 2.5.0
- *
- * @param int|string $width Optional. Width attribute value.
- * @param int|string $height Optional. Height attribute value.
- * @return string HTML attributes for width and, or height.
- */
-function image_hwstring($width, $height) {
-	$out = '';
-	if ($width)
-		$out .= 'width="'.intval($width).'" ';
-	if ($height)
-		$out .= 'height="'.intval($height).'" ';
-	return $out;
-}
-
-/**
  * Scale an image to fit a particular size (such as 'thumb' or 'medium').
  *
  * Array with image url, width, height, and whether is intermediate size, in
@@ -218,13 +192,24 @@
 function get_image_tag($id, $alt, $title, $align, $size='medium') {
 
 	list( $img_src, $width, $height ) = image_downsize($id, $size);
-	$hwstring = image_hwstring($width, $height);
-
-	$class = 'align' . esc_attr($align) .' size-' . esc_attr($size) . ' wp-image-' . $id;
-	$class = apply_filters('get_image_tag_class', $class, $id, $align, $size);
-
-	$html = '<img src="' . esc_attr($img_src) . '" alt="' . esc_attr($alt) . '" title="' . esc_attr($title).'" '.$hwstring.'class="'.$class.'" />';
 
+  $class = "align$align size-$size wp-image-$id";
+  $attr = array(
+    'src'	=> $img_src,
+    'width' => intval($width),
+    'height' => intval(height),
+		'class'	=> $class,
+    'alt'	=> $alt,
+    'title'	=> $title
+  );
+  $attr = array_map( 'esc_attr', $attr );
+  $attr['class'] = apply_filters('get_image_tag_class', $attr['class'], $id, $align, $size);
+
+  $html = rtrim("<img ");
+	foreach ( $attr as $name => $value ) {
+	  $html .= " $name=" . '"' . $value . '"';
+	}
+  $html .= ' />';
 	$html = apply_filters( 'get_image_tag', $html, $id, $alt, $title, $align, $size );
 
 	return $html;
@@ -633,17 +618,17 @@
  * @return string HTML img element or empty string on failure.
  */
 function wp_get_attachment_image($attachment_id, $size = 'thumbnail', $icon = false, $attr = '') {
-
 	$html = '';
 	$image = wp_get_attachment_image_src($attachment_id, $size, $icon);
 	if ( $image ) {
 		list($src, $width, $height) = $image;
-		$hwstring = image_hwstring($width, $height);
 		if ( is_array($size) )
 			$size = join('x', $size);
 		$attachment =& get_post($attachment_id);
 		$default_attr = array(
 			'src'	=> $src,
+      'height' => intval($height),
+      'width' => intval($width),
 			'class'	=> "attachment-$size",
 			'alt'	=> trim(strip_tags( get_post_meta($attachment_id, '_wp_attachment_image_alt', true) )), // Use Alt field first
 			'title'	=> trim(strip_tags( $attachment->post_title )),
@@ -656,7 +641,7 @@
 		$attr = wp_parse_args($attr, $default_attr);
 		$attr = apply_filters( 'wp_get_attachment_image_attributes', $attr, $attachment );
 		$attr = array_map( 'esc_attr', $attr );
-		$html = rtrim("<img $hwstring");
+		$html = rtrim("<img ");
 		foreach ( $attr as $name => $value ) {
 			$html .= " $name=" . '"' . $value . '"';
 		}
