Do you want the image to change every time a specific user visits a page, or everytime any user visits a page?
E.g. person 1 views page 3 times and sees images 1, 2 + 3. Person 2 comes along, does he see image 1 or 4?
If the specific user, you will want to store a cookie that keeps track of what image count they are on. Then on index.php: Check if cookie exists, if so, add 1 to it and save it, then get the image corresponding to that number and output it. If not, set the cookie, and get the image. There are a few different ways you could grab some text relating to the image. You could use a database, a notepad file or even hard code the text into the webpage. Gonna have to clarify on that for more specific help I fear
If you want the image to change for every user, you will need to have a database as you will have to store some information on your side. I can't really see why you would want to do this so won't bother explaining it.