Run the image processing in a separate thread