Efficient image reconstruction under sparsity constraints with application to MRI and bioluminescence tomography