Electromagnetic imaging for internal and external inspection of metallic pipes