Add a thumbnail function and make gravity a parameter for resizeAndCrop