only process 2 images at a time, and use pipes