Manual:$wgHashedSharedUploadDirectory

Details
If you operate multiple wikis, you can define a shared upload path using $wgSharedUploadPath. If $wgUseSharedUploads is set, the wiki will look in the shared repository if no file of the given name is found in the local repository (for, [[Media:..]] links).

Thumbnails will also be looked for and generated in this directory.

Uploads to the wiki will NOT be put there - they will be put into $wgUploadDirectory.

Set this setting to false especially if you have a set of files that need to be accessible by all wikis, and you do not want to use the hash (path/a/aa/) directory layout.