code: protected @Nullable HtmlElement<?> getMediaElement(@NotNull Media media) {
      PictureSource[] pictureSources = media.getMediaRequest().getMediaArgs().getPictureSources();
      if (pictureSources != null && pictureSources.length > 0) {
        return getPictureElement(media);
      }
      else {
        return getImageElement(media);
      }
    }
docs: Create <code>img</code> or <code>picture</code> media element.
  @param media Media metadata
  @return Media element with properties or null if media metadata is invalid