Added multithreading for image drawing