Escape apostrophes in the gallery data to avoid JSON parsing issues.