For the top, run some glue along the trim as well.
Stick the trim up as before on sealant, keep it away from the frame until it's straight/in correct position, then push onto frame.
Spray some activator along to set in place
Only a small bead of glue required!