BUG: sort Shark labels before encoding so that we know the order for the probability image
Since Shark assumes contiguous labels, we recode the incoming labels and decode them after predictions. This encoding does not ensure that the new labels are sorted as the incoming ones. However, when we want to generate the image containing the probability for each class, we need to ensure that the probabilities are in the correct order wrt the incoming labels.
This MR ensures that the encoding of the incoming labels keeps the original label order.