if (lc != null && lc.size() != retVal.getDefaultPixels().getSizeC())
if (lc != null && lc.size() == retVal.getDefaultPixels().getSizeC())
    public ImageData retrieveImage(int id, ImageData retVal)		throws DSOutOfServiceException, DSAccessException    {		//Make a new retVal if none was provided.    	if (retVal == null) retVal = new ImageData();		//Define the criteria by which the object graph is pulled out.		Criteria c = ImageMapper.buildImageCriteria(id);						//Load the graph defined by criteria.		Image image = (Image) gateway.retrieveData(Image.class, c);		//Put the server data into the corresponding client object.        if (image == null) return retVal;        ImageMapper.fillImage(image, retVal);        //retrieve the realSize of a pixels.        c = PixelsMapper.buildPixelsDimensionCriteria(id);        Dimensions pixelDim =             (Dimensions) gateway.retrieveSTSData("Dimensions", c);        if (pixelDim != null)            PixelsMapper.fillPixelsDimensions(pixelDim,                     retVal.getDefaultPixels());        c = PixelsMapper.buildLogicalChannelCriteria(                STSMapper.IMAGE_GRANULARITY, id);        List lc = (List) gateway.retrieveListSTSData("LogicalChannel", c);        //need to fix problem if no logical channel(shouldn't happen)        if (lc != null && lc.size() != retVal.getDefaultPixels().getSizeC())             retVal.setChannels(ImageMapper.fillImageChannels(lc));        else             retVal.setChannels(ImageMapper.fillDefaultImageChannels(                    retVal.getDefaultPixels().getSizeC()));	  		//Can be an empty data object.  		return retVal;	      }