Bugfix in MediaController and in TwigConnector

On some hosts (PHP 5.3 ones) the MediaController had some errors while
resolving the external path. These issues are now fixed. Also there was
a bug in the TwigConnector that only occurs on PHP 5.3 due to
differences in the closure scope.