Somtimes wee need to create a piece of code which creates the thumbnails of the given image. But Having a perfect code takes some time and effort. And why do effort if there are many opensource free available plugins can do your task is great way.
jQuery NailThumb is a nice jQuery Plugin which allow developers to create thumbnails easily from high-res images, without any distortion, with one line of code. If you want to change the default size of thumbnail, you can change it from thr CSS file.
Requirements: jQuery Framework
License: GPL License