Index: wp-includes/media.php
===================================================================
--- wp-includes/media.php	(revision 7890)
+++ wp-includes/media.php	(working copy)
@@ -359,7 +359,7 @@
 	), $attr));
 
 	$id = intval($id);
-	$attachments = get_children("post_parent=$id&post_type=attachment&post_mime_type=image&orderby={$orderby}");
+	$attachments = get_children( array('post_parent' => $id, 'post_status' => 'inherit', 'post_type' => 'attachment', 'post_mime_type' => 'image', 'orderby' => $orderby) );
 
 	if ( empty($attachments) )
 		return '';
