I wouldn't be surprised if I'm making this more complicated then it needs to be.

I have a checkbox that when checked will display many images in a table (that part actually works). BTW, this table is created in the code behind. The problem is when you deselect the checkbox, the images still show.

You can hide or display the images directly, without changing the class names. This means that all images that initially have the class name "hide" will be hidden on page load and all others will be visible. On checking the box the hidden images will be displayed. On unchecking the box those with class name "hide" will be hidden again.

This slightly modified script does that. Adding additional "hide"s to images will allow you to control which ones appear and disappear.