Revised addImage to use the new api.