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.