Added gallery cycling code