update code of image panel