Fix bug with preview on the file dialog