code: public static ExternalGraphicInfo createExternalGraphic(String href) {
  		ExternalGraphicInfo externalGraphic = new ExternalGraphicInfo();
  		FormatInfo format = new FormatInfo();
  		format.setFormat("image/" + getExtension(href));
  		externalGraphic.setFormat(format);
  		OnlineResourceInfo onlineResource = new OnlineResourceInfo();
  		onlineResource.setType("simple");
  		HrefInfo hrefInfo = new HrefInfo();
  		hrefInfo.setHref(href);
  		onlineResource.setHref(hrefInfo);
  		externalGraphic.setOnlineResource(onlineResource);
  		return externalGraphic;
  	}
docs: Creates an external graphic for the specified href.
  
  @param href the href
  @return the graphic