Python сохранить изображения от каталога в список

#this function loops over all files/images in a specified folder and stores them together
from PIL import Image
import glob
image_list = []
for filename in glob.glob('yourpath/*): #This downloads all file extentions
#For a specific extention use ('yourpath/*.yourextention')
    im=Image.open(filename)
    image_list.append(im)
    
Bewildered Boar