This is a tough one as it is easier said than done. While I didn’t take pictures, I like many, experienced the ruler shrinkage issue. It sounds silly but you have to learn to sneak up on your penis mentally. What I mean by that I will try to describe. If you sit down or stand up all mentally ready to measure or take pictures and are anticipating doing it then the second you reach for either a ruler or camera things seem to deflate instantly.
Here is the way I found to do at least the ruler part. Don’t measure when you are planning to measure. Keep one instantly handy to where you are masturbating. When you feel you are at your peak and think of it in an instant then try to keep in the mood and reach quickly for the ruler and measure while trying to stay as much in the zone of what got you hard in the first place. I did this enough and it got easier for me as I practiced more. Photos could be trickier because my mind would become more focused on doing multiple manual tasks while trying to also keep my arousal up.