This video tutorial from YouTube shows a simple implementation of image resizing and cropping using also CSS for defining image dimensions. Very interesting. It's useful to see how CSS actually interacts with the underlying JavaScript routines to get the desired result.