One of the great perks of youth is its prescribed distance from old age. However, empathy and compassion are open for all ages.
Adam, you may not be able to erase the imagery, but you might be able to re-direct how you recall the image. Take a moment to consider that one of the greatest obstacles for the elderly is their loss of independence. Many senior citizens need help with the most basic daily functions that the rest of us take for granted (...for now).
Chances are, if you saw "Gramps" naked, then you were probably helping him get dressed, bath, or go to the bathroom. No doubt, that had to be a very humbling moment for him. And from his humility he had to also entrust you with something most important to him-- his dignity. So from now on imagine that: For the final years of your grandfather's life, you have the awesome privilege to be the guardian of his dignity. It can be an experience that you choose to honor and cherish fondly.
In an earlier post you expressed how much you love and care for "Gramps". Well, you demonstrate that care by what you already do for him in the nursing home, as well as how you choose to remember him outside the nursing home.
I hope that helps you. Peace.