Thread:Project:Support desk/How do I efficiently manage unused images?/reply (3)

For the second point: Yes, MediaWiki does store the actual files in the filesystem, most likely inside the folder "images/". Thumbnails are also stored there. Additionally, a database record is created for each file.

There is the maintenance script deleteArchivedFiles.php, which allows you to permanently and irreversibly delete all deleted files. The maintenance script eraseArchivedFile.php in contrast allows you to irreversibly delete single deleted files and even single revisions of deleted files. Maybe, if you can create a list of the files/revisions to be deleted using some criteria, then you can easily put them into according calls to eraseArchivedFile.php and have every single one of them removed.