updating add_image api to merge json attributes as well