Deal means Gap will still have a UK high street presence within Next's stores despite closing its own.