diff --git a/src/wp-includes/media.php b/src/wp-includes/media.php
index 1cf3d3ff0b..6731a6562a 100644
--- a/src/wp-includes/media.php
+++ b/src/wp-includes/media.php
@@ -759,6 +759,12 @@ function image_get_intermediate_size( $post_id, $size = 'thumbnail' ) {
 			*/
 		} elseif ( ! empty( $imagedata['sizes']['thumbnail'] ) && $imagedata['sizes']['thumbnail']['width'] >= $size[0] && $imagedata['sizes']['thumbnail']['width'] >= $size[1] ) {
 			$data = $imagedata['sizes']['thumbnail'];
+		} elseif ( $size[0] == $imagedata['width'] && $size[1] == $imagedata['height'] ) {
+			$data = array(
+				'width'  => $imagedata['width'],
+				'height' => $imagedata['height'],
+				'file'   => wp_basename( $imagedata['file'] ),
+			);
 		} else {
 			return false;
 		}
@@ -768,6 +774,12 @@ function image_get_intermediate_size( $post_id, $size = 'thumbnail' ) {
 
 	} elseif ( ! empty( $imagedata['sizes'][ $size ] ) ) {
 		$data = $imagedata['sizes'][ $size ];
+	} elseif ( ! empty( $_wp_additional_image_sizes = wp_get_additional_image_sizes() ) && ! empty( $_wp_additional_image_sizes[ $size ] ) && $_wp_additional_image_sizes[ $size ]['width'] == $imagedata['width'] && $_wp_additional_image_sizes[ $size ]['height'] == $imagedata['height'] ) {
+		$data = array(
+			'width'  => $imagedata['width'],
+			'height' => $imagedata['height'],
+			'file'   => wp_basename( $imagedata['file'] ),
+		);
 	}
 
 	// If we still don't have a match at this point, return false.
