Changed slightly to look for img tags rather than target links