initial code to load images from file