<?php
add_action('pre_get_posts', function($query)
{
global $current_user, $pagenow;
if (!$current_user instanceof WP_User)
return;
if ($pagenow != 'admin-ajax.php' || $_REQUEST['action'] != 'query-attachments')
return;
if (!current_user_can('update_core'))
$query->set('author', $current_user->ID);
});