Deactivate and reactivate buttons in a photo gallery. How?

Suppose we have 10 buttons on the screen to show a photo gallery. When the user click on a button for exampel button no 1, how can I deactivate this for the period the photo no 1 is being seen and how I can reactivate this when he/she clicks on another button and so on ?