Hiding buttons on the stage

I have a thumbnail gallery consisting of small squares, which when clicked reveal a larger mosaic image directly below. The problem I have is how do I hide all the small squares when the larger image is in the over state. I’ve included a small example that demonstrates the problem.