make image keep ratio and don't exceeding the frame

Hi,Dr Ji

     I have done some works about the image display.

     I made the image keep ratio and don't exceeding the frame.

     Please check it.

     Thanks!
既然都是这个样式，就放到application.css文件里面吧，加个class