change selected class onclick rather than onmouseout

Just a quick change to some frontend javascript. I think it's better to change the thumbnail selection right away when a click happens.