changed image cropping for photo preview
fixed some miscellaneous bugs