Move image callback into addImage closure