Approximation of Caccioppoli sets, with applications to problems in image segmentation