Dirichlet problem and removable singularities for functionals with linear growth