preliminary code for processing a collection of images and a metadata file