Fix metadata tab selection

The only thing not working now is the change in selected tab if you have E.g. preview tab open on an image, then select a Dataset. I had some doubts whether I liked that behaviour anyway, so OK to leave it for now.