Simplify building media url, only build relative path once