Updated gallery nav code