fix name normalization

This fixes a regression that broke our website.
Media file names that had 'media' in their path would be corrupted: 

`medialibrary/2014/10/Living_23.jpg`  was changed to `media/ibrary/2014/10/Living_23.jpg`.