def METHOD_NAME(node: Node, app: "Application") -> PhotoImage:
    scale = app.app_scale
    image = None
    # node icon was overridden with a specific value
    if node.icon:
        try:
            image = images.from_file(node.icon, width=images.NODE_SIZE, scale=scale)
        except OSError:
            logger.error("invalid icon: %s", node.icon)
    # custom node
    elif is_custom(node):
        image_file = _get_custom_file(app.guiconfig, node.model)
        logger.info("custom node file: %s", image_file)
        if image_file:
            image = images.from_file(image_file, width=images.NODE_SIZE, scale=scale)
    # built in node
    else:
        image = images.from_node(node, scale=scale)
    # default image, if everything above fails
    if not image:
        image = images.from_enum(
            ImageEnum.EDITNODE, width=images.NODE_SIZE, scale=scale
        )
    return image