The Media Viewer is a software feature basically copied from the Lightbox used by Flickr. Its development and rollout by WMF has been object to controversies. For more information, see:
If you want to globally disable Media Viewer you need to create a page called "global.js" and insert the following code:
You can also disable this feature in your global preferences: select the "Appearance" section and uncheck "Enable Media Viewer".