I\'ve a code of some what like this:
All of the following solutions only work in recent browsers.
You can select by child position:
#foo img:first-child { /* for the bar */ }
#foo img:nth-child(2) { /* for the cat */ }
You can select by child position, counting only images:
#foo img:first-of-type { /* for the bar */ }
#foo img:nth-of-type(2) { /* for the cat */ }
You can select by image URL:
#foo img[src^=bar] { /* for the bar */ }
#foo img[src^=cat] { /* for the cat */ }