Approximation of free-discontinuity problems by elliptic functionals via Gamma-convergence