I currently do this to check if one of two elements exists:
if ($(\".element1\").length > 0 || $(\".element2\").length > 0) { //do stuff... }
All jQuery elements have the .length property. You can just go:
.length
if ($('img').length) // Implies: If this element exists..
http://jqueryfordesigners.com/element-exists/