I usually received a lot of questions regarding on how can you recover deleted messages on WhatsApp, Instagram or viber????
First of all these are Apps and once you delete the messages or photos anything I can pretty sure it will be gone.
I have personally tried this, I went on my WhatsApp and deleted a message and tried to find it, I am afraid no where to be seem.
So from what i can say WhatsApp does store the message on the databases, but they are encrypted, if you needed to retrieve the messages you would need to contact them..No data recovery can get to them because they are encrypted ..
Viber seem to give the opportunity to backup your messages using Gloogle Drive and if you deleted the App, you can restore the messages after installing the App.
If you have any further questions please just ask..
Thank you for reading