Merge replace-media branch

Yep, the replace media branch