Can be done after T278926: Move WikibaseRepo EntityLookup to service container.
This also uses getCachingCommonsMediaFileNameLookup(), which isn’t called anywhere else (and is private), so maybe that can be inlined. Or moved as a service to the service container, of course.