Photo upload: Detecting picture orientation automaticaly and rotate properly.