As a P.S., do know that staff find it as hard as you when someone dies.
Also, what she was liekly struggling with was fear, not pain. Part of this was what led up to her death and dying, and it isn't something you could have helped.
Too many die in fear in hospital, in denial, sometimes.
IT IS NOT YOUR FAULT,and take out some happy photos and keep those in your thoughts.
I was haunted by smells for weeks after my dad's death. I had to acknowledge these horrible memories, then let it go and put it out of my mind. It doesn't help to dwell on it.
/2 cents from one who has been there!