Fix a bug in calculating the photometric global rotation matrix

I can't believe I didn't catch this before. I had forgotten to
change a few things in this method when I organized it.