Hi, I'm sorry for the loss of your grandmother. I know it's a very sad and difficult thing to go through.
I know that it sounds cliche, but it true that everyone mourns in their own way. I understand that you have Pure O, I have a touch of that myself, and of course at this time of stress, sadness and loss, you will be feeling a bit scattered and not at ease, and the obsessive thoughts will start to invade. Try to not be too tough on yourself. In a very short amount of time, you have gone through a couple of life events, the loss of a loved one and graduating from high school. These two things are on the total opposite ends of the spectrum, one bringing great sadness about an inevitable fact that she passed away from her ill health, and the second being a celebration and culmination of your education and move toward adulthood, along with the apprehension of facing life after the security of high school. I don't think at this point you should be accessing how you should be reacting to things because in all honesty, you are going through too much to be so critical of yourself. Of course you are going to think about yourself on what was supposed to be your weekend. You've probably been looking forward to graduation for years and just because something sad and tragic happens, it doesn't mean that you are supposed to just drop these thoughts out of your mind. It's impossible and unnecessary. As you said, your grandmother would want you to be ok, and I'm sure she would have wanted you to be excited about your graduation.
As for when you pray and seeing images, you know how the Pure O works. It's trying to distract you. You said you have some issues with religion, so of course when thinking of death and the afterlife, this will remind you of your Pure O thoughts regarding religion. I think that considering your Pure O centers on religion and your thoughts that you're not a good Christian, then having these sorts of intrusive images is expected and not something that you should give thought to. Let the images come and go, and don't give them a value.
As for what you should be doing right now after your grandma has passed, it is probably best to carry on as best you can, you'll have your good moments and not so good. After my grandmother had passed away, I was sad, but she was in very ill health for over a decade and the grandmother I had as a child was no longer really present (she had Alzheimer's) so in some ways it was odd and it felt like I experienced her death twice. I was quite a bit older than you are when she passed, but I recalled not feeling as sad as I felt I should have felt. It bothered me greatly for some time. And then I just decided to sort of talk to her. I found a place that was quiet so I could collect my thoughts and I just I told her how I loved her, and that I felt sad she was so ill for such a long time and how I missed her and was deeply sad she passed away, even if I could no longer feel the deep sadness that I felt when she was first ill. But I felt this calmness that she was ok, and that she was finally at peace. She was deeply religious, where I am not at all, but I found comfort in that she probably felt comfort and peace where she is. I honor her in different ways now, some that seem very silly and insignificant to other people, but to me these little things always help me think of her, when she was alive and well, and running around all frisky. Maybe you'll find a few things that will help you think of her and it will help you find peace with her death and peace in that she is now at peace.
Don't be too tough on yourself. Just by writing about how much this is bothering you shows that you are a good grandson and loved your grandmother. I hope that in time you will feel more at ease about all of this, and you won't feel badly anymore about wanting to enjoy your graduation and your summer.