Fix: The filename could be wrong when saving a screenshot or thumbnails.

Filenames containing a dot but no extension were incorrectly modified.

This commit fixes ticket #2855.