Unsupervised Learning of Lagrangian Dynamics from Images for Prediction and Control