I can't decide which layout is better. Perhaps the one that is more spread-out?
It really depends on the aspect ratios of the images, and in what order they appear. If you had a bunch of portrait mode images in a row, they would look absurdly spread out if they were all lined up with an invisible 200x200 grid. If they're mostly landscape, it doesn't matter very much. But that's why there's no solution that works best all of the time.
This, of course, is why some skins just do fixed shape thumbnails, and don't mess with it any further. Of if they do non-fixed shape thumbnails, they put them in fixed shape boxes.