The Gallery; This is an app that pulls photos and videos from any folder that doesn't have a no.media file. It displays images from that photo editing app, from your camera, from that folder you put your downloaded images in etc etc.
The gallery is not a folder of its own. The way the Gallery app works is it just gathers and displays the image regardless of wherever it is stored. So when
you look at images you've taken in the Gallery app you are seeing the images in your DCIM Camera folder but through the Gallery app. Galley just displays the image and doesn't affect where the image lives. When you delete something you're deleting the original photo from its home.
Your options are, stop deleting photos using the Gallery app, because it deletes the actual photo, or start using a backup so you can remove the actual photo from your device while still retaining a copy that isn't on your phone taking up room. Gallery will do this if you use Samsung's cloud storage, they just merged with someone and I don't remember who they are using now. You can get similar results using Google Photos. GPhotos will allow you to delete images from your device, to free up space, while still backing them up and displaying on your phone.
Log in and talk to us if you really want help with this.