£10m gift to National Portrait Gallery is most significant in its history