I think this forum is about the plugin, and not about errors in your own code. If everybody starts posting questions like “please find an error in this piece of program”, we will become a more luxury support site than ExpertExchange.
WordPress: How to limit authors to their own content
From here you can click on Manage Access button that brings the Default Access Settings for all Media post type. With this form you manage default access to all media post types for Editor role as well as you do it separately for the Backend, Frontend and RESTful/XML-RPC API sides and also for media posts or media categories (if enabled). Now simply on the Default Frontend Access To All Media check READ BY OTHERS option and for the Default Backend Access To All Media check LIST TO OTHERS, EDIT BY OTHERS, DELETE BY OTHERS and PUBLISH BY OTHERS options. This way you reassure that other users absolutely do not have ability to manage media assets that do not belong to them on the Backend side.