Make gallery rendering depend on full rendering of post (fix #1158)