else { ret = handleTempImage( image, prefix, needMap ); }
	protected String handleImage(IImage image, Object context, String prefix, boolean needMap)	{		String mapID = null;		if(needMap)		{			mapID = getImageMapID(image);			if(map.containsKey(mapID))			{				return (String)map.get(mapID);			}		}		String ret = null;		if (context != null				&& (context instanceof HTMLRenderContext))		{			HTMLRenderContext myContext = (HTMLRenderContext) context;			String imageURL = myContext.getBaseImageURL();			String imageDir = myContext.getImageDirectory();			if(imageURL==null || imageURL.length()==0					|| imageDir==null || imageDir.length()==0)			{				log.log(Level.SEVERE, "imageURL or ImageDIR is not set!"); //$NON-NLS-1$				return null;			}						String fileName; 			File file;			synchronized (HTMLCompleteImageHandler.class)			{				String extension = image.getExtension();				if(extension!=null && extension.length()>0)				{					fileName = createUniqueFileName(imageDir, prefix, extension); //$NON-NLS-1$				}				else				{					fileName = createUniqueFileName(imageDir, prefix); 				}				file = new File(imageDir, fileName); //$NON-NLS-1$				try				{					image.writeImage(file);				}				catch (IOException e)				{					log.log(Level.SEVERE,e.getMessage(),e);				}			}			//servlet mode			if(imageURL.indexOf("?")>0) //$NON-NLS-1$			{				ret = imageURL + fileName;			}			else if(imageURL.endsWith("/")) //$NON-NLS-1$			{				ret = imageURL + fileName;			}			else			{				ret = imageURL + "/" + fileName; //$NON-NLS-1$			}						if(needMap)			{				map.put(mapID, ret);			}		}		return ret;	}