This change will allow e.g. rich text editing of the captions, as in the media dialog.
In addition to modifying the gallery dialog, a new ve.dm.MWGalleryImageNode class will be required, similar to ve.dm.MWBlockImageNode but specifically for gallery images. The image captions and gallery captions should be able to make use of ve.dm.MWImageCaptionNode.