Image Orientation

Is there a way for it to recognize the horizon and have the default orientation to something more like this?