You're right in that there shouldn't be an underline on an image that is a link. At least not by default.
However, your css would never work as you're not going to have an 'a' tag enclosed inside of an img tag.
Any chance of you posting your html/css up?