Add contextual links to nodes in Media Gallery view.

From #2308.