Create thumbnail plugin: improvements of tmp dir handling