Added some comments to resizeImage function