code: public List<TiffObject> getImageIfds() {
      List<TiffObject> l = new ArrayList<TiffObject>();
      IFD oifd = this.firstIFD;
      while (oifd != null) {
        if (oifd.isImage()) {
          if (oifd.hasSubIFD()) {
            try {
              long length = oifd.getMetadata().get("ImageLength").getFirstNumericValue();
              long width = oifd.getMetadata().get("ImageWidth").getFirstNumericValue();
              long sublength =
                  oifd.getsubIFD().getMetadata().get("ImageLength").getFirstNumericValue();
              long subwidth = oifd.getsubIFD().getMetadata().get("ImageWidth").getFirstNumericValue();
              if (sublength > length && subwidth > width) {
                l.add(oifd.getsubIFD());
              } else {
                l.add(oifd);
              }
            } catch (Exception ex) {
              l.add(oifd);
            }
          } else {
            l.add(oifd);
          }
        }
        oifd = oifd.getNextIFD();
      }
      return l;
    }
docs: Returns a list of ifds representing Images.
  
  @return the ifds list