Added gallery function for gallery post format