The National Portrait Gallery brings the eerie power of a historic medium into focus