If you just use the width, portrait oriented photos have blurry thumbnails. This changes the thumbnail generation code to use the largest dimension.
Before and after screenshots: