Fix JS error when adding new media

Probably shouldn't be one liner. Also, space after function needed.