fix bug when autorotate is true but no preview is created
fix indent