Index: src/wp-includes/theme.php
===================================================================
--- src/wp-includes/theme.php	(revision 60000)
+++ src/wp-includes/theme.php	(working copy)
@@
 function get_uploaded_header_images() {
-	$header_images = array();
-
-	// Grab the header images from the database.
-	$custom_headers = get_posts(
-		array(
-			'post_type'      => 'attachment',
-			'post_mime_type' => 'image',
-			'meta_key'       => '_wp_attachment_is_custom_header',
-			'meta_value'     => get_stylesheet(),
-			'orderby'        => 'menu_order',
-			'order'          => 'ASC',
-			'numberposts'    => -1,
-		)
-	);
-
-	foreach ( (array) $custom_headers as $header ) {
-		$url                     = wp_get_attachment_url( $header->ID );
-		$header_images[ $header->ID ] = array(
-			'url'           => $url,
-			'thumbnail_url' => wp_get_attachment_thumb_url( $header->ID ),
-			'description'   => $header->post_content,
-		);
-	}
-
-	return $header_images;
+	static $cached_header_images = null;
+	if ( null !== $cached_header_images ) {
+		return $cached_header_images;
+	}
+
+	$header_images = array();
+
+	// Grab the header images from the database.
+	$custom_headers = get_posts(
+		array(
+			'post_type'      => 'attachment',
+			'post_mime_type' => 'image',
+			'meta_key'       => '_wp_attachment_is_custom_header',
+			'meta_value'     => get_stylesheet(),
+			'orderby'        => 'menu_order',
+			'order'          => 'ASC',
+			'numberposts'    => -1,
+		)
+	);
+
+	foreach ( (array) $custom_headers as $header ) {
+		$url                          = wp_get_attachment_url( $header->ID );
+		$header_images[ $header->ID ] = array(
+			'url'           => $url,
+			'thumbnail_url' => wp_get_attachment_thumb_url( $header->ID ),
+			'description'   => $header->post_content,
+		);
+	}
+
+	$cached_header_images = $header_images;
+	return $cached_header_images;
 }
