Code which spawn threads to capture screenshots