lets try to make a more flexible and dynamics validation i.e.
types = ["jpg", "png", "bmp"]
 if file_extension in types
      list_image.append(image)