Update AddImageTask for non-static case db locking API