Start processing images as soon as they are read
In an attempt to clean up the threadForEach function getting rid of the
sleep call and instead using condition_variable, I decided it would make
more sense to add the items to be processed to a queue and process them
as soon as they are added. The result is slightly less messy. It needs
quite a bit of work, primarily how the threads exit.