fixes nasty media insert target bug

Fixes #143 and Fixes #145 and References #121