rotate the pictures if needed