To prevent this, a nifty little application called 'pessulus' can be used to lock down the panels.
It can be installed in ubuntu as follows.
$ sudo apt-get install 'pessulus'
Lock down the panel as shown in the screenshot below.
No more messing up the panel icons when changing the screen resolution :)