Rebased/dev 5 0/saved by display 3

This PR should fixed the problem described by @pwalczysko (https://github.com/openmicroscopy/openmicroscopy/pull/2697) and @gusferguson (https://trac.openmicroscopy.org.uk/ome/ticket/12434)
i.e. class cast exception