made thumbnail generation multi threaded