<html>
<head>
<script type="text/javascript">
function refresh()
{
window.location.href="Enter your Link here"
}
</script>
</head>
<body>
<button type="button" onclick="refresh()">Refresh Now</button>
</body>
</html>
so on the button click the page wil be refreshed. You can write this line "window.location.href" into your script which saves the image.
hope this works for you.