script which create JPEG thumbnails