Queue deletion of entry during preview

- Correctly handle removing missing files during preview without making the quick panel inconsistent with the history (only relevant when `remove_non_existent_files_on_preview` is enabled).
- Corrected bug in `get_history_by_index` that caused an error when the user selected the first entry from the `opened` list (see #29).