Adding code to load images from diretory iterator