def METHOD_NAME(app):
    from .app import App
    assert isinstance(app, App)
    assert app.crawler is not None
    # download or generate cover
    app.progress = 0
    futures = [
        app.crawler.executor.submit(
            _fetch_cover_image,
            app,
        )
    ]
    # download content images
    image_folder = os.path.join(app.output_path, "images")
    images_to_download = set(
        [
            (filename, url)
            for chapter in app.chapters
            for filename, url in chapter.get("images", {}).items()
        ]
    )
    futures += [
        app.crawler.executor.submit(
            _fetch_content_image,
            app,
            url,
            os.path.join(image_folder, filename),
        )
        for filename, url in images_to_download
    ]
    failed = []
    try:
        app.crawler.resolve_futures(futures, desc="  Images", unit="item")
        failed = [
            filename
            for filename, url in images_to_download
            if not os.path.isfile(os.path.join(image_folder, filename))
        ]
    finally:
        logger.info("Processed %d images [%d failed]" % (app.progress, len(failed)))
    for chapter in app.chapters:
        _discard_failed_images(app, chapter, failed)