def METHOD_NAME(kwargs, host, args):
    '''
    Loop through all entries that don't have a thumbnail and create it.
    '''
    try:
        # Get ID for all entries without a thumbnail
        pending = gramex.data.filter(url=var.FORMS_URL, table=var.FORMS_TABLE, args=args)
        width, height = 300, 300  # TODO: Change dimensions later
        for _index, row in pending.iterrows():
            id = row[var.FORMS_ID]
            url = f'{host}/form/{id}'
            # TODO: Use delay='renderComplete'
            content = capture.png(
                url, selector=".container", width=width, height=height, delay=1000
            )
            # Save under GRAMEXDATA/uifactory/thumbnail/<id>.png, cropped to width and height
            target = os.path.join(var.GRAMEXDATA, 'uifactory', 'thumbnail', f'{id}.png')
            Image.open(BytesIO(content)).crop((0, 0, width, height)).save(target)
            # Update the database with the thumbnail filename
            gramex.data.update(
                url=var.FORMS_URL,
                table=var.FORMS_TABLE,
                id=var.FORMS_ID,
                args={var.FORMS_ID: [id], 'thumbnail': [f'thumbnail/{id}.png']},
            )
    # Exceptions in a thread are not logged by default. Log them explicitly on console.
    # Otherwise, we won't know WHY something failed
    except Exception:
        app_log.exception('Screenshot failed')
        raise