Vid 1976 unit tests

Adding some unit tests for media galleries. 
Hm, good point. In fact, if the caption doesn't exist, i'm still instantiating a caption object, which is dumb. I'll fix that in the code.