fixed orientation detection for grid preview