Updates the preview for the selected file.