Do not hard code media directory (reverted from commit 20361b18b35d81cc5fb16789b7e6e2b9d44586d0)