set image background
refactor code to OO style
update position when onMessage triggered