Fix crash on finishing working thread

Was due to a race condition when calling the callback function
from the second thread stack.  Fixed by using GObject.idle_add().
Restrict image formats to the ones supported by PIL