Index: wp-admin/includes/ajax-actions.php
===================================================================
--- wp-admin/includes/ajax-actions.php	(revision 22833)
+++ wp-admin/includes/ajax-actions.php	(working copy)
@@ -1780,10 +1780,10 @@
  * @since 3.5.0
  */
 function wp_ajax_get_attachment() {
-	if ( ! isset( $_REQUEST['id'] ) )
+	if ( ! isset( $_REQUEST['post_id'] ) )
 		wp_send_json_error();
 
-	if ( ! $id = absint( $_REQUEST['id'] ) )
+	if ( ! $id = absint( $_REQUEST['post_id'] ) )
 		wp_send_json_error();
 
 	if ( ! current_user_can( 'read_post', $id ) )
@@ -1826,10 +1826,10 @@
  * @since 3.5.0
  */
 function wp_ajax_save_attachment() {
-	if ( ! isset( $_REQUEST['id'] ) || ! isset( $_REQUEST['changes'] ) )
+	if ( ! isset( $_REQUEST['post_id'] ) || ! isset( $_REQUEST['changes'] ) )
 		wp_send_json_error();
 
-	if ( ! $id = absint( $_REQUEST['id'] ) )
+	if ( ! $id = absint( $_REQUEST['post_id'] ) )
 		wp_send_json_error();
 
 	check_ajax_referer( 'save-attachment', 'nonce' );
@@ -1868,10 +1868,10 @@
  * @since 3.5.0
  */
 function wp_ajax_save_attachment_compat() {
-	if ( ! isset( $_REQUEST['id'] ) )
+	if ( ! isset( $_REQUEST['post_id'] ) )
 		wp_send_json_error();
 
-	if ( ! $id = absint( $_REQUEST['id'] ) )
+	if ( ! $id = absint( $_REQUEST['post_id'] ) )
 		wp_send_json_error();
 
 	if ( empty( $_REQUEST['attachments'] ) || empty( $_REQUEST['attachments'][ $id ] ) )
Index: wp-includes/js/media-editor.js
===================================================================
--- wp-includes/js/media-editor.js	(revision 22833)
+++ wp-includes/js/media-editor.js	(working copy)
@@ -448,7 +448,8 @@
 				return media.post( 'send-attachment-to-editor', {
 					nonce:      wp.media.view.settings.nonce.sendToEditor,
 					attachment: options,
-					html:       html
+					html:       html,
+					post_id:    wp.media.view.settings.postId
 				}).done( function( resp ) {
 					wp.media.editor.insert( resp );
 				});
@@ -456,10 +457,11 @@
 
 			link: function( embed ) {
 				return media.post( 'send-link-to-editor', {
-					nonce: wp.media.view.settings.nonce.sendToEditor,
-					src:   embed.linkUrl,
-					title: embed.title,
-					html:  wp.media.string.link( embed )
+					nonce:   wp.media.view.settings.nonce.sendToEditor,
+					src:     embed.linkUrl,
+					title:   embed.title,
+					html:    wp.media.string.link( embed ),
+					post_id: wp.media.view.settings.postId
 				}).done( function( resp ) {
 					wp.media.editor.insert( resp );
 				});
Index: wp-includes/js/media-models.js
===================================================================
--- wp-includes/js/media-models.js	(revision 22833)
+++ wp-includes/js/media-models.js	(working copy)
@@ -223,8 +223,8 @@
 				options = options || {};
 				options.context = this;
 				options.data = _.extend( options.data || {}, {
-					action: 'get-attachment',
-					id: this.id
+					action:  'get-attachment',
+					post_id: this.id
 				});
 				return media.ajax( options );
 
@@ -235,9 +235,9 @@
 
 				// Set the action and ID.
 				options.data = _.extend( options.data || {}, {
-					action: 'save-attachment',
-					id:     this.id,
-					nonce:  media.model.settings.saveAttachmentNonce
+					action:  'save-attachment',
+					post_id: this.id,
+					nonce:   media.model.settings.saveAttachmentNonce
 				});
 
 				// Record the values of the changed attributes.
@@ -268,8 +268,8 @@
 			var model = this;
 
 			return media.post( 'save-attachment-compat', _.defaults({
-				id:     this.id,
-				nonce:  l10n.saveAttachmentNonce
+				post_id: this.id,
+				nonce:   l10n.saveAttachmentNonce
 			}, data ) ).done( function( resp, status, xhr ) {
 				model.set( model.parse( resp, xhr ), options );
 			});
@@ -619,6 +619,11 @@
 				if ( -1 !== args.posts_per_page )
 					args.paged = Math.floor( this.length / args.posts_per_page ) + 1;
 
+				// Check if a post ID has been specified as a context.
+				if ( args.context )
+					options.data.post_id = args.context;
+				delete args.context;
+
 				options.data.query = args;
 				return media.ajax( options );
 
Index: wp-includes/js/media-views.js
===================================================================
--- wp-includes/js/media-views.js	(revision 22833)
+++ wp-includes/js/media-views.js	(working copy)
@@ -12,6 +12,10 @@
 	media.view.settings = l10n.settings || {};
 	delete l10n.settings;
 
+	// Set the post ID as the default context of attachment queries.
+	if ( ! _.isUndefined( media.view.settings.postId ) )
+		media.model.Query.defaultProps.context = media.view.settings.postId;
+
 	// Check if the browser supports CSS 3.0 transitions
 	$.support.transition = (function(){
 		var style = document.documentElement.style,
