diff --git a/src/wp-includes/media.php b/src/wp-includes/media.php
index 135ee95..3520d73 100644
--- a/src/wp-includes/media.php
+++ b/src/wp-includes/media.php
@@ -643,34 +643,41 @@ function get_intermediate_image_sizes() {
 }
 
 /**
- * Retrieve an image to represent an attachment.
- *
- * A mime icon for files, thumbnail or intermediate size for images.
+ * Retrieve the image source and width/height for an attachment.
  *
  * @since 2.5.0
  *
- * @param int $attachment_id Image attachment ID.
- * @param string $size Optional, default is 'thumbnail'.
- * @param bool $icon Optional, default is false. Whether it is an icon.
- * @return bool|array Returns an array (url, width, height), or false, if no image is available.
+ * @param  int          $attachment_id Attachment ID.
+ * @param  string $size Optional, default is 'thumbnail'.
+ * @param  bool $icon   Optional, default is false. Whether to return the icon for the attachment's mime-type.
+ * @return bool|array   Returns an array (url, width, height), or false, if no image is available.
  */
-function wp_get_attachment_image_src($attachment_id, $size='thumbnail', $icon = false) {
-
-	// get a thumbnail or intermediate image if there is one
-	if ( $image = image_downsize($attachment_id, $size) )
-		return $image;
-
-	$src = false;
+function wp_get_attachment_image_src( $attachment_id, $size = 'thumbnail', $icon = false ) {
+	$return = false;
+	// If the attachment is an image, get an image.
+	if ( wp_attachment_is_image( $attachment_id ) ) {
+		$return = image_downsize( $attachment_id, $size );
+	}
 
-	if ( $icon && $src = wp_mime_type_icon($attachment_id) ) {
+	if ( $icon && ! $return && $src = wp_mime_type_icon( $attachment_id ) ) {
 		/** This filter is documented in wp-includes/post.php */
 		$icon_dir = apply_filters( 'icon_dir', ABSPATH . WPINC . '/images/media' );
-		$src_file = $icon_dir . '/' . wp_basename($src);
-		@list($width, $height) = getimagesize($src_file);
+		$src_file = $icon_dir . '/' . wp_basename( $src );
+		@list( $width, $height ) = getimagesize( $src_file );
+		$return = array( $src, $width, $height );
 	}
-	if ( $src && $width && $height )
-		return array( $src, $width, $height );
-	return false;
+	/**
+	 * Filter the attachment image source array.
+	 *
+	 * @since 4.0.0
+	 *
+	 * @param array|false $return        An assoc. array containing the image's src, width and height,
+	 *                                   false if no attachment image was found.
+	 * @param int         $attachment_id Attachment ID.
+	 * @param string      $size          Image size.
+	 * @param bool        $icon          Whether to return the image as its mime-type icon.
+	 */
+	return apply_filters( 'wp_attachment_image_src', $return, $attachment_id, $size, $icon );
 }
 
 /**
