I'm not entirely sure javascript is the route for this, but I can't seem to figure out another way. Basically, what I'm trying to achieve is create a 100px by 100px square thumbnail of an image that can be clicked on to display the actual, full sized image. Now, the problem is, the full sized images are people uploaded by any visitor to the site, so they won't always be perfect squares where I would be able to just define a width and height. In order to keep with the layout, I need the 100px by 100px thumbnail, so I'm wondering what would be the best way to acheive this when all the uploaded full sized images may not be perfect squares where they could jsut be resized.

If you're still not sure what I mean, here's a quick example:

A user uploads a picture that is 1200x983px, but the thumbnail for this picture must be 100x100px. If I were to just do something like <img height="100px" width="100px" />, the image would be all distorted since a perfectly square photo was not used, and if I were to just define a width of 100px only, the height may not be 100px.