To configure this you have to go to Settings/Chats and there deactivate the option that says Visibility of multimedia files. Because if this option is activated all the photos and videos will be downloaded to the mobile, and they will be seen in the image gallery.
It is also possible to set this setting for particular chats and not for all. This can be especially useful in those group chats where heavy content is constantly being sent.
To make use of the personalized option, you have to go to the conversation in which you want to use this tool, click on the three points in the upper margin, then on Group info/media file visibility and disable the option.
Create a .nomedia file
If you want to download the files but they do not appear in the mobile gallery, you can create a .nomedia file in the WhatsApp images folder. This will hide all photos from the app.
How is it done?
1. Download a file explorer from the Google Play Store.
2. In the file explorer, go to Pictures/WhatsApp Pictures/
3. Create a file called .nomedia
If you want to see the photos in the cell phone gallery again, you simply have to delete the .nomedia file.