Fix a bug in the preview of images in file input