Added function to search for linked media by NID.