Existence and uniqueness of minimizers of general least gradient problems