IBM developerWorks has posted the second part of their series covering the development of PHP and Ajax to create a photo gallery application. In this part, they work off of the gallery already created in part one, taking care of one issue that plagues Ajax application - the breaking of the back button.
They start with a look at what it means to "save state" in the browser, including the use of the Back button to navigate between pages. Seeing that Ajax breaks this, they move ahead with a simple solution - creating an internal history stact for the application and use its own navigation methods. They provide some examples images to use and all of the code you'll need to accomplish this.