Thanks for the idea. But I didnt have to write SortCommand again. I just did the following
'-buttoncommand' => sub {
$main::oldimage = $_[0]->cget (-image);
$_[0]->configure (-image => $main::newimage);
$main::newimage = $main::oldimage;
$_[0]->SortColumn;
}