Fix a bug where media with spaces in the name would get a corrupted name.