First, turn off your phone's auto-sync feature, especially if your phone is set to automatically sync with Google Drive, Dropbox, and OneDrive. Also, prevent your phone from automatically deleting pictures from your phone's storage. You can do this by going into your settings menu and disabling the auto-delete feature.
Something similar happened to me where I thought I lost my photos too. Try checking under 'View all' in your gallery.
If not, always worth checking for the files under 'My Files' too.