remove trailing slash in media dir