I'm not sure what script that you have. Most of the image handler scripts update each time the script runs, as you described. I'm not aware of any self updating scripts.
Are you going to use this for animation? If so, a cron job will need to run the script every xx minutes to get a sequence of pictures.
Curly