Magnetic resonance imaging of pacemakers and implantable defibrillators