remove tmpfile usage when generating thumbnails