Most of it was recorded, the "Watch me do" workflow action is really slick.
I could clean this up with some more work to make it more general, but instead I'll walk you through making your own.
Open up Automator, and click "Choose" to make a new workflow from the "Custom" template.
Now, head over to Firefox, and open up the Picture settings page.
Open up a Finder window with your file in it off to the side of the screen.
Now, click the "Record" button in Automator and try and upload your new picture. A couple notes: First, make sure you click on the Firefox window to bring it to the front. Also, if you have to scroll in the file chooser, it won't work. You'll need to drag the file in from a Finder window.
Once you've tried to upload the picture, click the Stop button on the floating Automator window.
Now, we want to add in a "Pause" action to give the page long enough to load. Then, we'll record another action to click the back button. Finally, top it off with a "Loop" action to send it back to the start, and you're all done. Just remember to watch it and stop it if its done.