There's nothing wrong with this sentence, though unless you have some specific reason for using the perfect tense here, it would be more natural to say:
"I couldn't stop laughing while I was looking at this photo."
I don't like "viewing" here; it sounds formal and literary. It's okay to be formal and literary, of course, but there doesn't seem any reason to use "viewing" here.
I'm not sure I've answered your answered your question, but am firing this off because you asked for a response "asap."