Someone may send you a photo using text messaging (MMS) as an attachment.
To keep it takes two steps:
1.Download attachment by tapping on it.
2. Then, in order to save downloaded photos sent from messaging you need an additional app called SaveMMS. Click here for it.
That same app can automatically always save photos attached to MMS messaging.
Separately, to be sure that your photos are always backed up in a safe place, you should always set them up to automatically back up in Settings.
They will then always appear in your Photos regardless of whether you have erased them on your phone, as long as they are in the cloud.