Pion and thermal photon spectra as a possible signal for a phase transition