Index: wp-includes/post.php
===================================================================
--- wp-includes/post.php	(revision 6137)
+++ wp-includes/post.php	(working copy)
@@ -1284,6 +1284,8 @@
 
 	// export array as variables
 	extract($object, EXTR_SKIP);
+	if ( empty( $post_parent ) && isset( $object['post_parent'] ) && ! empty( $object['post_parent'] ) ) 
+		$post_parent = $object['post_parent'];
 
 	// Make sure we set a valid category
 	if (0 == count($post_category) || !is_array($post_category)) {
Index: wp-admin/js/upload.js
===================================================================
--- wp-admin/js/upload.js	(revision 6137)
+++ wp-admin/js/upload.js	(working copy)
@@ -201,6 +201,7 @@
 			h += "<td><textarea name='post_content' id='post_content'>" + this.currentImage.description + "</textarea></td>";
 			h += "</tr><tr id='buttons' class='submit'><td colspan='2'><input type='button' id='delete' name='delete' class='delete alignleft' value='" + this.deleteText + "' onclick='theFileList.deleteFile(" + id + ");' />";
 			h += "<input type='hidden' name='from_tab' value='" + this.tab + "' />";
+			h += "<input type='hidden' name='post_parent' value='" + parseInt(this.postID,10) + "' />";
 			h += "<input type='hidden' name='action' id='action-value' value='save' />";
 			h += "<input type='hidden' name='ID' value='" + id + "' />";
 			h += "<input type='hidden' name='_wpnonce' value='" + this.nonce + "' />";
