docs: def preview(file):
      """Render appropriate template with embed flag."""
      params = deepcopy(current_app.config['IIIF_PREVIEWER_PARAMS'])
      if 'image_format' not in params:
          params['image_format'] = \
              'png' if file.has_extensions('.png') else 'jpg'
      return render_template(
          current_app.config['IIIF_PREVIEW_TEMPLATE'],
          file=file,
          file_url=ui_iiif_image_url(
              file.file,
              **params
          )
      )