Custom version of mediawiki extension LoopMediaHandler