You could return an extra parameter, using an object:
return {links: links, type: "img"};
You can then use something like this:
var links = find();
if(links["type"] === "img")
console.log("I'm an image!");
else if(links["type"] === "href")
console.log("I'm a link!");