I defined as your and WordPress concatenates an ugly url: example.com/wordpress/../apps/media/some-image.jpg.
The problem is WordPress use $siteurl
instead of WP_HOME or WP_CONTENT_URL in the wp-includes/functions.php.
Can’t figure out how to modify that without touching the core.