On use of inhomogeneous media for elimination of ill-posedness in the inverse problem