I'm cross-posting the following message from S6 Edge. Hope you find it helpful.
Possible solution: Clearing your app preferences via Application Manager.
Fyi, I picked up an S6 (not Edge) yesterday and today noticed that when viewing pics from the Gallery app, the pics would not rotate as expected. Oddly, when viewing the pics via the Camera app they would rotate. So, I contacted Samsung support this afternoon via chat and was able to "fix" the issue... for now. Tech support had me reset app preferences via the Application Manager. Once I selected "Reset app preferences" the issue was resolved. However, tech support could not identify the root cause besides suggesting that it "might be an issues with some caches" possibly caused by third party apps. Here's the relevant (and amusing) part of my exchange (emphasis added):
Me: How do I avoid this problem, though?
Me: It's natural to change settings and prefs.
Me: None of them relate in any obvious ways to auto-rotate.
Tech: I should also inform you that it will not occur repeatedly.
...
Me: I asked how do I avoid this problem?
Me: I don't understand how any of my changes are responsible for this glitch.
Me: You said it won'
Me: won't happen repeatedly.
Me: How do you know this to be the case? What's the root problem?
Tech: I should inform you it will not happen repeatedly.
Tech: When you try to install the Third party applications which has cache in it might cause the issue.
Me: Don't all apps use cache?
Tech: All the Apps uses the Cache.
Me: So, how do you know this won't happen frequently?
Me: It happened already since I got the phone yesterday.
Tech: There is no option to avoid it <ME>.
Tech: If there are any such options I would have provided you.
Me: Is Samsung working to correct this problem?
Tech: It is not a glitch.
Tech: Yes Ian.
Me: It's not a glitch?
Me: But Samsung is working to fix it?
Tech: Yes.