Allow deletion of media that are associated with galleries.

Right now the way the mapping is set up there is no cascade of deletes from the Media to the GalleryHasMedia. This means that if you attempt to delete Media and there are still GalleryHasMedia entities pointing at it you get a foreign key error.

Closes #576

Cascade removal from Media to GalleryHasMedia.
that means that all media in a gallery are deleted when the gallery is deleted. is that the intention, can media only be in one single gallery?

this affects all doctrine flavors, right? does it make sense for orm and mongo too?