Diffusion Bridges for Stochastic Hamiltonian Systems and Shape Evolutions