Untested...
But with no reloadthepage(), try to have a "different image" for same page?
Then I guess this would be easier be done through PHP, which look like the last line below:
PHP Code:
...
<a href="<?=$_SERVER['PHP_SELF']?>?gra=sign" onClick="reloadthepage()">Sign Up</a> -
<a href="<?=$_SERVER['PHP_SELF']?>">Login</a>
</div>
<img src="mygraph.jpg?<?=rand()?>">