On a class of variational problems with linear growth related to image inpainting