Hard photons: production mechanisms and nuclear dynamics