diff --git src/wp-admin/custom-header.php src/wp-admin/custom-header.php
index 8b2973fc11..aa6d619625 100644
--- src/wp-admin/custom-header.php
+++ src/wp-admin/custom-header.php
@@ -1187,6 +1187,11 @@ wp_nonce_field( 'custom-header-options', '_wpnonce-custom-header-options' ); ?>
 		$attachment_id = wp_insert_attachment( $object, $cropped );
 		$metadata = wp_generate_attachment_metadata( $attachment_id, $cropped );
 
+		// If this is a crop, save the original attachment ID as metadata.
+		if ( $parent_id ) {
+			$metadata['attachment_parent'] = $parent_id;
+		}
+		
 		/**
 		 * Filters the header image attachment metadata.
 		 *
@@ -1197,11 +1202,8 @@ wp_nonce_field( 'custom-header-options', '_wpnonce-custom-header-options' ); ?>
 		 * @param array $metadata Attachment metadata.
 		 */
 		$metadata = apply_filters( 'wp_header_image_attachment_metadata', $metadata );
-		wp_update_attachment_metadata( $attachment_id, $metadata );
 
-		if ( $parent_id ) {
-			$meta = add_post_meta( $attachment_id, '_wp_attachment_parent', $parent_id, true );
-		}
+		wp_update_attachment_metadata( $attachment_id, $metadata );
 
 		return $attachment_id;
 	}
diff --git src/wp-includes/theme.php src/wp-includes/theme.php
index 2ee66fbddf..e84af8b385 100644
--- src/wp-includes/theme.php
+++ src/wp-includes/theme.php
@@ -1214,7 +1214,7 @@ function get_uploaded_header_images() {
 		$header_images[$header_index]['url'] =  $url;
 		$header_images[$header_index]['thumbnail_url'] = $url;
 		$header_images[$header_index]['alt_text'] = get_post_meta( $header->ID, '_wp_attachment_image_alt', true );
-		$header_images[$header_index]['attachment_parent'] = (int) get_post_meta( $header->ID, '_wp_attachment_parent', true );
+		$header_images[$header_index]['attachment_parent'] = isset( $header_data['attachment_parent'] ) ? $header_data['attachment_parent'] : '';
 
 		if ( isset( $header_data['width'] ) )
 			$header_images[$header_index]['width'] = $header_data['width'];
