Kluge-y attempt to fix error occurring after use of segmentation with OMERO. Really need to understand fully as selected is initialised to 0 so unsure why this code fails on zero