Generalized thumbnail loading, allows easier reloading of thumbnails later on
Unified file index variable for image & thumbnail mode
Count number of marked files
Pass marked files to external key handler in thumbnail mode; fixes issue #135
Fixed wrong thumbnail-to-file mappings caused by file deletions