PHP uses the escape character '/' in order to properly insert apostrophes without cutting the SQL query short. Before displaying text pulled from the database, you should use stripslashes on it (PHP function that removes escape characters).
Apprently we've forgotten to do this is a few spots, but you can easily fix it yourself if you want.
Line 532 in gallery.php $output.= $row["name"].'
change that to: $output.= SmartStripSlashes($row["name"]).'
You can add that SmartStripSlashes function to any string output where you see the escaped apostrophe.
THat exact line will not be there but the function will still be there. You won't be able to just search and find it you will have to look through it. You will want to look in functions that generate the album title so you can start by looking for parts that have "album" in it.