The code quoted in your post uses the jQuery script library. Do you have it associated with your page?
If so, your code will execute as written. However, what it says to do is that onclick of any image tag within the unique element with the id of 'motiongallery' the element(s) with the class of 'show' should be hidden and the unique element with the id of the name attribute of the image that was clicked should be shown.
By itself, this might not do anything, or might not do what is intended, because you would also have to have other markup and styles on the page to support it.
Even assuming you have all that, I kind of doubt that's exactly what you want to have, considering the scripts you say you are working with. If it is indeed workable with the scripts you said it was originally being used with, it could probably be adapted. I have my doubts even on that score, because name attributes and ids often get confused in IE, so while others may be fine with it, IE may have a problem. But, since jQuery is involved, that library may sort out that mess for you in IE, I've just never tried it.
If you want more help:
Please post a link to the page on your site that contains the problematic code so we can check it out.