Praise be to Allah.
Pictures on mobile phones and computers, and in videos, do not come under the same ruling as photographs on paper, because they are not fixed and do not last, unless they are printed out. Based on that, there is nothing wrong with keeping them on one’s mobile phone, so long as they do not include anything that is haram, such as if they are pictures of women.
Please see the answer to question no. 10326 .
But the picture of the deceased should not be used as a background on one’s mobile phone or Messenger, because that may prompt renewal of grief, or veneration and exaggeration, if the deceased was a teacher or educator. Moreover – realistically speaking – the matter is not free of disrespect, because a mobile phone may be thrown right and left, or taken into the washroom, and the like.
And Allah knows best.