Fix file name on generate thumbnails

Fix file name for thumbnails
If we use file names:
photo.1.jpg
photo.2.jpg
photo.3.jpg

all thumbnails will be "photo.jpg"
Merge pull request #141 from Bournwog/patch-3

Fix file name on generate thumbnails