Fixed race condition: Multiple threads are not allowed to write to the
same image, make sure of that we the output image locker