Refactor imagerep update