Index: wp-includes/media.php
===================================================================
--- wp-includes/media.php	(revision 23061)
+++ wp-includes/media.php	(working copy)
@@ -1375,11 +1375,21 @@
 
 				// Nothing from the filter, so consult image metadata if we have it.
 				$size_meta = $meta['sizes'][ $size ];
+
+				// We have the actual image size, but might need to further constrain it if content_width is narrower.
+				// This is not necessary for thumbnails and medium size.
+				if ( 'thumbnail' == $size || 'medium' == $size ) {
+					$width = $size_meta['width'];
+					$height = $size_meta['height'];
+				} else {
+					list( $width, $height ) = image_constrain_size_for_editor( $size_meta['width'], $size_meta['height'], $size );
+				}
+
 				$sizes[ $size ] = array(
-					'height'      => $size_meta['height'],
-					'width'       => $size_meta['width'],
+					'height'      => $height,
+					'width'       => $width,
 					'url'         => $base_url . $size_meta['file'],
-					'orientation' => $size_meta['height'] > $size_meta['width'] ? 'portrait' : 'landscape',
+					'orientation' => $height > $width ? 'portrait' : 'landscape',
 				);
 			}
 		}
