update handling of image adding/updating