XML Filter

I have a photogallery that initially loads all of my images with thumbnails. What I want is to have a checkbox next to my thumbnails that filter out certain images as well as their thumbnails. I’m not sure how to do this.

Do I have to reload the XML and with the function loading each thumbnail or is there a way to do this that simply hides/shows those images and thumbnails? I’m guessing that I have rerun through the xml so that my thumbnails are evenly spaced apart. What’s the fastest way to go through the images and filter out the ones I don’t want to show?

Help Kirupa!