Update gallery to remove index offset php warning