Automatic cropping and scaling using facedetection