Measurement of isolated photon production in pp and PbPb collisions at sqrt(s)=2.76 TeV