added code to crop the image to a square