Hydride shift and Ring Expansion Below is a problem I got stuck at in a test .

The first compund in this chain was easy to figure out , it was something like this : 
Then I had this intermediate compound for B.(I didn't add the bromide anion because this is where my confusion starts)  
Now ,here it shouldn't be correct to do a hydride shift outside the ring as it would result in a much less stable carbocation . But if I proceed using that idea and solving further for part D and E , I am getting option (b) as my answer and the correct answer is option (d).
Although if I do a hydride shift there then that opens a way for a ring expansion and hence a correct answer (according to the answer key) .
Ring expansion takes place in the step $\ce{D-&gt;E}$.
You were going right till the intermediate. Your intermediate will be attacked by $\ce{Br-}$ anions (as temp. is normal, therefore $\ce{S_N1}$ mechanism). Product will be B.
Then, it will form grignard reagent as C, which will react with aldehyde to produce alcohol D.
After that, it will react with HI to form a carbocation intermediate, which will rearrange to give product E.
The whole mechanism is as follows,