Vid 1976 unit tests

Adding some unit tests for media galleries. 
 So I fixed it so that if a caption doesn't exist, it doesn't create a new caption object. However, any testing of caption/media should be done in a separate unit test file, as this is just testing gallery.js. I simplified the creation of the model to sorta reflect this.