Make sure to pop first not processed image when using threading