Globally Optimal Joint Image Segmentation and Shape Matching based on Wasserstein Modes