PIL use main thread