code: @Override
      public void onImage(ResourceReference reference, boolean freestanding, Map<String, String> parameters)
      {
          Map<String, String> attributes = new LinkedHashMap<String, String>();
  
          try {
              // First we need to compute the image SRC attribute value.
              String imageSrcAttributeValue = getImageSrcAttributeValue(reference, parameters);
  
              // Then add it as an attribute of the IMG element.
              attributes.put(XHTMLImageRenderer.SRC, imageSrcAttributeValue);
  
              // Add the class if we're on a freestanding uri
              if (freestanding) {
                  attributes.put(CLASS, "wikimodel-freestanding");
              }
  
              // Add the other parameters as attributes
              attributes.putAll(parameters);
  
              // If no ALT attribute has been specified, add it since the XHTML specifications makes it mandatory.
              if (!parameters.containsKey(XHTMLImageRenderer.ALTERNATE)) {
                  attributes.put(XHTMLImageRenderer.ALTERNATE, computeAltAttributeValue(reference));
              }
  
              // And generate the XHTML IMG element.
              getXHTMLWikiPrinter().printXMLElement(XHTMLImageRenderer.IMG, attributes);
          } catch (Throwable e) {
              // Error title
              getXHTMLWikiPrinter().printXMLStartElement(SPAN, new String[][] { { CLASS, "xwikirenderingerror" } });
              getXHTMLWikiPrinter().printXML(e.getMessage());
              getXHTMLWikiPrinter().printXMLEndElement(SPAN);
  
              // Error details
              getXHTMLWikiPrinter().printXMLStartElement(SPAN,
                  new String[][] { { CLASS, "xwikirenderingerrordescription hidden" } });
              getXHTMLWikiPrinter().printXMLStartElement(TT, new String[][] { { CLASS, "wikimodel-verbatim" } });
              getXHTMLWikiPrinter().printXML(ExceptionUtils.getStackTrace(e));
              getXHTMLWikiPrinter().printXMLEndElement(TT);
              getXHTMLWikiPrinter().printXMLEndElement(SPAN);
          }
      }
docs: {@inheritDoc}
  
  @see XHTMLImageRenderer#onImage(org.xwiki.rendering.listener.reference.ResourceReference , boolean,
  java.util.Map)
  @since 2.5RC1