diff --git a/wp-includes/post-formats.php b/wp-includes/post-formats.php
index 0d80a3833a..5bec3aac44 100644
--- a/wp-includes/post-formats.php
+++ b/wp-includes/post-formats.php
@@ -380,12 +380,17 @@ function post_formats_compat( $content, $id = 0 ) {
$image = is_numeric( $meta['image'] ) ? wp_get_attachment_url( $meta['image'] ) : $meta['image'];
if ( ! empty( $image ) && ! stristr( $content, $image ) ) {
- $image_html = sprintf(
- '',
- empty( $compat['image_class'] ) ? '' : sprintf( 'class="%s" ', esc_attr( $compat['image_class'] ) ),
- $image
- );
- if ( empty( $meta['url'] ) ) {
+ if ( false === strpos( $image, '',
+ empty( $compat['image_class'] ) ? '' : sprintf( 'class="%s" ', esc_attr( $compat['image_class'] ) ),
+ $image
+ );
+ } else {
+ $image_html = $image;
+ }
+
+ if ( empty( $meta['url'] ) || false !== strpos( $image, '