code: private Element buildImageElement(Media media, Element element) {
      if (media.isValid()) {
        element.setAttribute("src", media.getUrl());
      }
      return element;
    }
docs: Builds image element for given media metadata.
  @param media Media metadata
  @param element Original element
  @return Image element or null if media reference is invalid