Fixed bug that cropped up when images had spaces in the filename