@chrisnasah , replace the code with this.
Some images are shorter because I put max-height as 600px, not the height. So all images can go upto maximum of 600, it doesn’t have to be 600. If I make it 600, then it might stretch and lose quality and it’ll look very ugly.