Make the image previewer work with files