Added some initial code to handle croping image to fit preview size