This should fix the images race condition and also slightly reduce computation time.

fixes issue #71