On the photopyroelectric detection of phase transitions