Fix bug in thumbnail refresh on file format change.

On changing the file format, a reset of last selected image index was missing. If the user chose the first file of format A and then switched to the first file of format B, the thumbnail was not be refreshed.