code: def convert_to_aim_image_list(images, labels=None) -> List[Image]:
      aim_images = []
      if labels is not None:
          labels_it = chain(labels, repeat(""))
      else:
          labels_it = repeat("")
      for img, lbl in zip(images, labels_it):
          aim_img = Image(
              img, lbl if isinstance(lbl, str) else str(lbl.item())
          )
          aim_images.append(aim_img)
      return aim_images
  
imports: import logging
  import os.path
  from PIL import Image, ImageSequence
  from io import BytesIO
  from itertools import chain, repeat
  from typing import List
  import numpy
  from aim.sdk.num_utils import inst_has_typename
  from aim.storage.object import CustomObject
  from aim.storage.types import BLOB
label_desc: Use image node_id 1 for calling a global function with example usage: convert_to_aim_image_list(images, labels) and returns: aim_images