I would recommend Soudal sealant, I always use the Silirub 2, it is a bit more expensive than some others on the market, but is a pure silicone, no fillers.
As for the inside, are you really talking about gaps, or do you mean the reveal liners.
Foam is okay for filling, but then you...