def METHOD_NAME(self):
    images = self.get_installed_images()
    grubenv = subprocess.check_output(["/usr/bin/grub-editenv", HOST_PATH + "/grub/grubenv", "list"], text=True)
    m = re.search(r"next_entry=(\d+)", grubenv)
    if m:
        next_image_index = int(m.group(1))
    else:
        m = re.search(r"saved_entry=(\d+)", grubenv)
        if m:
            next_image_index = int(m.group(1))
        else:
            next_image_index = 0
    return images[next_image_index]