Fixes media library links

Hi Chris.
These changes allow links to media library items to work in the 301 module.