Now taking centered-square subimage as thumbnail.

Fixed resize algorithm code broken wrt rectangle Min/Max bounds.
Added stack trace reporting to error handlers.