diff --git wp-admin/js/post-formats.js wp-admin/js/post-formats.js
index 4a1b527..283fff8 100644
--- wp-admin/js/post-formats.js
+++ wp-admin/js/post-formats.js
@@ -118,7 +118,7 @@ window.wp = window.wp || {};
 				mediaPreview('video', url, mime);
 			} else {
 				// set the hidden input's value
-				$field.val(url);
+				$field.val(id);
 				// Show the image in the placeholder
 				$el.html('<img src="' + url + '" />');
 				$holder.removeClass('empty').show();
diff --git wp-includes/media.php wp-includes/media.php
index dfcb62c..f41f63e 100644
--- wp-includes/media.php
+++ wp-includes/media.php
@@ -2367,6 +2367,12 @@ function get_the_image( $attached_size = 'full', &$post = null ) {
 	if ( isset( $post->format_content ) )
 		return $post->format_content;
 
+	$meta = get_post_format_meta( $post->ID );
+	if ( ! empty( $meta['image'] ) ) {
+		$post->format_content = wp_get_attachment_image( $meta['image'], $attached_size );
+		return $post->format_content;
+	}
+
 	$medias = get_attached_images();
 	if ( ! empty( $medias ) ) {
 		$media = reset( $medias );
diff --git wp-includes/post-formats.php wp-includes/post-formats.php
index 5c34774..9487ad0 100644
--- wp-includes/post-formats.php
+++ wp-includes/post-formats.php
@@ -289,7 +289,7 @@ function post_formats_compat( $content, $id = 0 ) {
 		return $content;
 
 	$format = get_post_format( $post );
-	if ( empty( $format ) || in_array( $format, array( 'status', 'aside', 'chat' ) ) )
+	if ( empty( $format ) || in_array( $format, array( 'status', 'aside', 'chat', 'gallery' ) ) )
 		return $content;
 
 	if ( current_theme_supports( 'structured-post-formats', $format ) )
@@ -308,8 +308,6 @@ function post_formats_compat( $content, $id = 0 ) {
 	$show_content = true;
 	$format_output = '';
 	$meta = get_post_format_meta( $post->ID );
-	// passed by ref in preg_match()
-	$matches = array();
 
 	switch ( $format ) {
 		case 'link':
@@ -341,11 +339,34 @@ function post_formats_compat( $content, $id = 0 ) {
  			}
 			break;
 
+		case 'image':
+			if ( ! empty( $meta['image'] ) ) {
+				$image = is_numeric( $meta['image'] ) ? wp_get_attachment_url( $meta['image'] ) : $meta['image'];
+
+				if ( ! empty( $image ) && ! stristr( $content, $image ) ) {
+					$image_html = sprintf(
+						'<img %ssrc="%s" alt="" />',
+						empty( $compat['image_class'] ) ? '' : sprintf( 'class="%s" ', esc_attr( $compat['image_class'] ) ),
+						$image
+					);
+					if ( empty( $meta['url'] ) ) {
+						$format_output .= $image_html;
+					} else {
+						$format_output .= sprintf(
+							'<a href="%s">%s</a>',
+							esc_url( $meta['url'] ),
+							$image_html
+						);
+					}
+				}
+			}
+			break;
+
 		case 'quote':
 			if ( ! empty( $meta['quote'] ) && ! stristr( $content, $meta['quote'] ) ) {
 				$quote = sprintf( '<blockquote>%s</blockquote>', wpautop( $meta['quote'] ) );
 				if ( ! empty( $meta['quote_source'] ) ) {
-					$source = ( empty( $quote_meta['url'] ) ) ? $meta['quote_source'] : sprintf( '<a href="%s">%s</a>', esc_url( $meta['url'] ), $meta['quote_source'] );
+					$source = ( empty( $meta['url'] ) ) ? $meta['quote_source'] : sprintf( '<a href="%s">%s</a>', esc_url( $meta['url'] ), $meta['quote_source'] );
 					$quote .= sprintf( '<figcaption class="quote-caption">%s</figcaption>', $source );
 				}
 				$format_output .= sprintf( '<figure class="quote">%s</figure>', $quote );
