Please see my comments to the Solution 1.
You should always specify either width or height, or none of them. If you specify both, you risk showing some of the images in wrong aspect ratio
. Please see:
Re-sampling down may mean waste of traffic resources. And re-sampling up usually gives unacceptable quality. That said, even if you use CSS or
tag attributes to modify the sizes of images, you should better have source images on the server side preliminary re-sampled closer to the required sized. It's not a problem to keep source image files in two versions: full-size and the version for thumbnails.