To avoid implementing code that rewrites image URLs, we will place images in the repository and change the templates to point to the live server URL of the image.
There does not seem to be a case for which the application relies on rewriting image URLs. There are actually only two files uploaded to the MediaWiki that are being used in templates. Those two files are referred to as spenden.wikimedia.de/wiki/..., which the web server redirects to the machine running the wiki.
Unless @gabriel-wmde has some example, where this is the case, I consider this task as done/invalid.