code: public String getItemImageUrl(final TreeItemImage item, final String itemId) {
  
  		if (item == null) {
  			return null;
  		}
  
  		// Check if has image url
  		String url = item.getUrl();
  		if (!Util.empty(url)) {
  			return url;
  		}
  
  		// Check if has image
  		Image image = item.getImage();
  		if (image == null) {
  			return null;
  		}
  
  		// Check static resource
  		if (image instanceof InternalResource) {
  			return ((InternalResource) image).getTargetUrl();
  		}
  
  		// Build targetted url
  		Environment env = getEnvironment();
  		Map<String, String> parameters = env.getHiddenParameters();
  		parameters.put(Environment.TARGET_ID, getTargetId());
  
  		String cacheKey = item.getImageCacheKey();
  
  		if (Util.empty(cacheKey)) {
  			// Add some randomness to the URL to prevent caching
  			String random = WebUtilities.generateRandom();
  			parameters.put(Environment.UNIQUE_RANDOM_PARAM, random);
  		} else {
  			// Remove step counter as not required for cached content
  			parameters.remove(Environment.STEP_VARIABLE);
  			parameters.remove(Environment.SESSION_TOKEN_VARIABLE);
  			// Add the cache key
  			parameters.put(Environment.CONTENT_CACHE_KEY, cacheKey);
  		}
  
  		// Item id
  		parameters.put(ITEM_REQUEST_KEY, itemId);
  
  		// The targetable path needs to be configured for the portal environment.
  		url = env.getWServletPath();
  
  		// Note the last parameter. In javascript we don't want to encode "&".
  		return WebUtilities.getPath(url, parameters, true);
  	}
docs: Retrieves a URL for the tree item image.
  <p>
  This method is used by the WTree Renderer.
  </p>
  
  @param item the tree item
  @param itemId the tree item id
  @return the URL to access the tree item image.