Index: wp-includes/media.php
===================================================================
--- wp-includes/media.php	(revision 15838)
+++ wp-includes/media.php	(working copy)
@@ -144,7 +144,7 @@
 
 	// try for a new style intermediate size
 	if ( $intermediate = image_get_intermediate_size($id, $size) ) {
-		$img_url = str_replace(basename($img_url), $intermediate['file'], $img_url);
+		$img_url = $intermediate['url'];
 		$width = $intermediate['width'];
 		$height = $intermediate['height'];
 		$is_intermediate = true;
@@ -523,6 +523,8 @@
 function image_get_intermediate_size($post_id, $size='thumbnail') {
 	if ( !is_array( $imagedata = wp_get_attachment_metadata( $post_id ) ) )
 		return false;
+		
+	$file_url = wp_get_attachment_url($post_id);
 
 	// get the best one for a specified set of dimensions
 	if ( is_array($size) && !empty($imagedata['sizes']) ) {
@@ -530,8 +532,10 @@
 			// already cropped to width or height; so use this size
 			if ( ( $data['width'] == $size[0] && $data['height'] <= $size[1] ) || ( $data['height'] == $size[1] && $data['width'] <= $size[0] ) ) {
 				$file = $data['file'];
+				if(!empty($data['path'])) $path = $data['path'];
+				if(!empty($data['url'])) $url = $data['url'];
 				list($width, $height) = image_constrain_size_for_editor( $data['width'], $data['height'], $size );
-				return compact( 'file', 'width', 'height' );
+				return image_add_path_and_url_to_meta($file_url, $imagedata['file'], compact( 'file', 'width', 'height' , 'path', 'url'));
 			}
 			// add to lookup table: area => size
 			$areas[$data['width'] * $data['height']] = $_size;
@@ -550,8 +554,10 @@
 						continue;
 					// If we're still here, then we're going to use this size
 					$file = $data['file'];
+					if(!empty($data['path'])) $path = $data['path'];
+					if(!empty($data['url'])) $url = $data['url'];
 					list($width, $height) = image_constrain_size_for_editor( $data['width'], $data['height'], $size );
-					return compact( 'file', 'width', 'height' );
+					return image_add_path_and_url_to_meta($file_url, $imagedata['file'], compact( 'file', 'width', 'height' , 'path', 'url'));
 				}
 			}
 		}
@@ -561,12 +567,15 @@
 		return false;
 
 	$data = $imagedata['sizes'][$size];
-	// include the full filesystem path of the intermediate file
-	if ( empty($data['path']) && !empty($data['file']) ) {
-		$file_url = wp_get_attachment_url($post_id);
-		$data['path'] = path_join( dirname($imagedata['file']), $data['file'] );
+	return image_add_path_and_url_to_meta($file_url, $imagedata['file'], $data);
+}
+
+// include the full filesystem path of the intermediate file
+function image_add_path_and_url_to_meta($file_url, $file, $data){
+	if ( empty($data['path']) && !empty($data['file']) )
+		$data['path'] = path_join( dirname($file), $data['file'] );
+	if ( empty($data['url']) && !empty($data['file']) )
 		$data['url'] = path_join( dirname($file_url), $data['file'] );
-	}
 	return $data;
 }
 
Index: wp-admin/includes/image-edit.php
===================================================================
--- wp-admin/includes/image-edit.php	(revision 15838)
+++ wp-admin/includes/image-edit.php	(working copy)
@@ -202,7 +202,7 @@
 
 	if ( $filepath && file_exists($filepath) ) {
 		if ( 'full' != $size && ( $data = image_get_intermediate_size($post_id, $size) ) )
-			$filepath = path_join( dirname($filepath), $data['file'] );
+			$filepath = $data['path'];
 	} elseif ( WP_Http_Fopen::test() ) {
 		$filepath = wp_get_attachment_url($post_id);
 	}
