Or you can use a service like https://www.imgix.com or https://www.filepicker.com and let them to the hard in real time.
That way if you want to change your image dimension later you don't have to go back and resize the images.
That way if you want to change your image dimension later you don't have to go back and resize the images.