Changes to move image handling into a task not under the control of the callback.