Upgraded the gallery again - this time to v1.5.8, and also updated php to the latest version. Only problem is this time I didn't follow my own advice and make a backup first! Luckily I've got a daily backup, so I should just be able to copy the important files back like html_wrap, and the css files. Hoorah it worked*. * apart from breaking the "latest comments" button, and the random front page image. doh!