refactor TagImage()