start to refactor the code a bit, use multiprocessing to parallelize the image processing