code: private String buildScaledMediaUrl(Dimension dimension, CropDimension cropDimension) {
      String resourcePath = this.resource.getPath();
  
      // if parent resource is a nt:file resource, use this one as path for scaled image
      Resource parentResource = this.resource.getParent();
      if (JcrBinary.isNtFile(parentResource)) {
        resourcePath = parentResource.getPath();
      }
  
      // URL to render scaled image via {@link InlineRenditionServlet}
      String path = resourcePath + "." + ImageFileServlet.SELECTOR
          + "." + dimension.getWidth() + "." + dimension.getHeight()
          + (cropDimension != null ? "." + cropDimension.getCropString() : "")
          + (this.mediaArgs.isContentDispositionAttachment() ? "." + MediaFileServlet.SELECTOR_DOWNLOAD : "")
          + "." + MediaFileServlet.EXTENSION + "/"
          // replace extension based on the format supported by ImageFileServlet for rendering for this rendition
          + ImageFileServlet.getImageFileName(getFileName());
  
      // build externalized URL
      UrlHandler urlHandler = AdaptTo.notNull(this.adaptable, UrlHandler.class);
      return urlHandler.get(path).urlMode(this.mediaArgs.getUrlMode()).buildExternalResourceUrl(this.resource);
    }
docs: Builds URL to rescaled version of the binary image.
  @return Media URL