First, in case you haven't seen it yet, go on YouTube and check out Ed's Official "Photograph" video, it'll all make more sense. He put it out a few hours before Mother's Day.
This song isn't just about mending a relationship with your partner, it's more about restoring the relationship with your family, more specifically Ed and his mother. Now looking at it, "Loving can hurt" seems to come from the Mother's or caretaker's point of view, because taking responsibility for a child can be frustrating and difficult, but also rewarding and Ed is spot on when he says, "you know it can get hard sometime." The the Pre-Chorus, "we keep this love in a photograph..." describes all the memories they've made, then the Chorus comes in. In the Chorus, "So you can keep me..." relates to when Ed decided to leave home and pursue music full time, and (now I'm assuming), his mother must have given him a photograph of the family to always have before he left, hoping that one day their "eyes" will "meet" again. Until then, Ed just thinks "wait for me to come home."
Now, the next verse jumps into Ed and his mother's minds: "loving can heal" refers to how they use the memories to mend or counter the separation/ the distance, or it's like insight from his mother's point of view where even though raising a child can be difficult, it's rewarding because "loving can heal." "And it's the only thing we take with us when we die" refers to the memories they've made and kept.
Then, the Pre-chorus and Chorus comes back, making the message stronger, but music is now building and intensifying the emotion, thus strengthening the message. "And I won't ever let you go..." refers to that unconditional love parents have for their children: it's a love that is true and ever persistent through any kind of pain.
That bridge or tag part, "wait for me to come home" reinforces that desire of being reunited. Then, in the final chorus, the lyric, "next to your heartbeat where I should be" relates to keeping those you love close to your heart always, while those who have impacted you life the most stay within your soul. The last section of that chorus, is a reflection of maybe the last time Ed was with his mother and family before leaving when he was young(er) and the lyrics are last conversation with his mom.