diff --git tests/media.php tests/media.php
index abc62c5..5732de4 100644
--- tests/media.php
+++ tests/media.php
@@ -15,6 +15,9 @@ CAP;
     $this->img_content = <<<CAP
 <img src="pic.jpg" id='anId' alt="pic"/>
 CAP;
+	$this->img_name = 'image.jpg';
+	$this->img_url = 'http://' . WP_TESTS_DOMAIN . '/wp-content/uploads/' . $this->img_name;
+	$this->img_dimensions = array( 'width' => 100, 'height' => 100 );
   }
 
   function test_img_caption_shortcode_added() {
@@ -169,4 +172,184 @@ CAP;
 		$this->assertEquals( '-1B', wp_convert_bytes_to_hr( -1 ) );
 		$this->assertEquals( '0B', wp_convert_bytes_to_hr( 0 ) );
 	}
+
+	/**
+	 * @ticket 22960
+	 */
+	function test_get_attached_images() {
+		$post_id = $this->factory->post->create();
+		$attachment_id = $this->factory->attachment->create_object( $this->img_name, $post_id, array(
+			'post_mime_type' => 'image/jpeg',
+			'post_type' => 'attachment'
+		) );
+
+		$images = get_attached_images( $post_id );
+		$this->assertEquals( $images, array( $attachment_id => get_post( $attachment_id ) ) );
+	}
+
+	/**
+	 * @ticket 22960
+	 */
+	function test_get_attached_image_srcs() {
+		$post_id = $this->factory->post->create();
+		$this->factory->attachment->create_object( $this->img_name, $post_id, array(
+			'post_mime_type' => 'image/jpeg',
+			'post_type' => 'attachment'
+		) );
+
+		$images = get_attached_image_srcs( $post_id );
+		$this->assertEquals( $images, array( $this->img_url ) );
+	}
+
+	/**
+	 * @ticket 22960
+	 */
+	function test_content_images() {
+		$blob =<<<BLOB
+This is a sentence that will all of a sudden contain <img src="{$this->img_url}"/>
+BLOB;
+
+		$images = get_content_images( $blob );
+		$this->assertEquals( $images, array( $this->img_url ) );
+	}
+
+	/**
+	 * @ticket 22960
+	 */
+	function test_content_image() {
+		$blob =<<<BLOB
+This is a sentence that will all of a sudden contain <img src="{$this->img_url}"/>
+BLOB;
+
+		$image = get_content_image( $blob );
+		$this->assertEquals( $image, $this->img_url );
+	}
+
+	/**
+	 * @ticket 22960
+	 */
+	function test_content_galleries() {
+		$ids1 = array();
+		$ids1_srcs = array();
+		foreach ( range( 1, 3 ) as $i ) {
+			$attachment_id = $this->factory->attachment->create_object( "image$i.jpg", 0, array(
+				'post_mime_type' => 'image/jpeg',
+				'post_type' => 'attachment'
+			) );
+			wp_update_attachment_metadata( $attachment_id, $this->img_dimensions );
+			$ids1[] = $attachment_id;
+			$ids1_srcs[] = 'http://' . WP_TESTS_DOMAIN . '/wp-content/uploads/' . "image$i.jpg";
+		}
+
+		$ids2 = array();
+		$ids2_srcs = array();
+		foreach ( range( 4, 6 ) as $i ) {
+			$attachment_id = $this->factory->attachment->create_object( "image$i.jpg", 0, array(
+				'post_mime_type' => 'image/jpeg',
+				'post_type' => 'attachment'
+			) );
+			wp_update_attachment_metadata( $attachment_id, $this->img_dimensions );
+			$ids2[] = $attachment_id;
+			$ids2_srcs[] = 'http://' . WP_TESTS_DOMAIN . '/wp-content/uploads/' . "image$i.jpg";
+		}
+
+		$ids1_joined = join( ',', $ids1 );
+		$ids2_joined = join( ',', $ids2 );
+
+		$blob =<<<BLOB
+[gallery ids="$ids1_joined"]
+
+[gallery ids="$ids2_joined"]
+BLOB;
+
+		$post_id = $this->factory->post->create( array( 'post_content' => $blob ) );
+		$galleries = get_content_galleries( get_post_field( 'post_content', $post_id ) );
+		$expected = array(
+			array( 'ids' => $ids1_joined, 'src' => $ids1_srcs ),
+			array( 'ids' => $ids2_joined, 'src' => $ids2_srcs )
+		);
+		$this->assertEquals( $galleries, $expected );
+	}
+
+	/**
+	 * @ticket 22960
+	 */
+	function test_post_galleries_images() {
+		$ids1 = array();
+		$ids1_srcs = array();
+		foreach ( range( 1, 3 ) as $i ) {
+			$attachment_id = $this->factory->attachment->create_object( "image$i.jpg", 0, array(
+				'post_mime_type' => 'image/jpeg',
+				'post_type' => 'attachment'
+			) );
+			wp_update_attachment_metadata( $attachment_id, $this->img_dimensions );
+			$ids1[] = $attachment_id;
+			$ids1_srcs[] = 'http://' . WP_TESTS_DOMAIN . '/wp-content/uploads/' . "image$i.jpg";
+		}
+
+		$ids2 = array();
+		$ids2_srcs = array();
+		foreach ( range( 4, 6 ) as $i ) {
+			$attachment_id = $this->factory->attachment->create_object( "image$i.jpg", 0, array(
+				'post_mime_type' => 'image/jpeg',
+				'post_type' => 'attachment'
+			) );
+			wp_update_attachment_metadata( $attachment_id, $this->img_dimensions );
+			$ids2[] = $attachment_id;
+			$ids2_srcs[] = 'http://' . WP_TESTS_DOMAIN . '/wp-content/uploads/' . "image$i.jpg";
+		}
+
+		$ids1_joined = join( ',', $ids1 );
+		$ids2_joined = join( ',', $ids2 );
+
+		$blob =<<<BLOB
+[gallery ids="$ids1_joined"]
+
+[gallery ids="$ids2_joined"]
+BLOB;
+		$post_id = $this->factory->post->create( array( 'post_content' => $blob ) );
+		$srcs = get_post_galleries_images( $post_id );
+		$this->assertEquals( $srcs, array( $ids1_srcs, $ids2_srcs ) );
+	}
+
+	/**
+	 * @ticket 22960
+	 */
+	function test_post_gallery_images() {
+		$ids1 = array();
+		$ids1_srcs = array();
+		foreach ( range( 1, 3 ) as $i ) {
+			$attachment_id = $this->factory->attachment->create_object( "image$i.jpg", 0, array(
+				'post_mime_type' => 'image/jpeg',
+				'post_type' => 'attachment'
+			) );
+			wp_update_attachment_metadata( $attachment_id, $this->img_dimensions );
+			$ids1[] = $attachment_id;
+			$ids1_srcs[] = 'http://' . WP_TESTS_DOMAIN . '/wp-content/uploads/' . "image$i.jpg";
+		}
+
+		$ids2 = array();
+		$ids2_srcs = array();
+		foreach ( range( 4, 6 ) as $i ) {
+			$attachment_id = $this->factory->attachment->create_object( "image$i.jpg", 0, array(
+				'post_mime_type' => 'image/jpeg',
+				'post_type' => 'attachment'
+			) );
+			wp_update_attachment_metadata( $attachment_id, $this->img_dimensions );
+			$ids2[] = $attachment_id;
+			$ids2_srcs[] = 'http://' . WP_TESTS_DOMAIN . '/wp-content/uploads/' . "image$i.jpg";
+		}
+
+		$ids1_joined = join( ',', $ids1 );
+		$ids2_joined = join( ',', $ids2 );
+
+		$blob =<<<BLOB
+[gallery ids="$ids1_joined"]
+
+[gallery ids="$ids2_joined"]
+BLOB;
+		$post_id = $this->factory->post->create( array( 'post_content' => $blob ) );
+		$srcs = get_post_gallery_images( $post_id );
+		$this->assertEquals( $srcs, $ids1_srcs );
+	}
 }
