While Imperial does have a good rep UCSD might serve you better in terms of getting an MS/PhD track in the US. Mainly because profs there know the system and you get offered undergrad research opportunities.
But yeah even more you should be looking at the individual courses and see which you think suits you better. Don't worry too much about prestige as it will be your performance that decides where you end up.