Fix gallery content parsing issue