generate images using multiple threads to increase performance