I've been facing the restart issue for over a year now. The only long term solution I could think of is restarting the phone every morning. You may alternatively try doing that every night.Pls let me know if this resolved the issue.
you may want to try the following, not sure if it works, but still you may want to give it a shot: settings - general management - reset photos and saved files as such are not lost.