A simple method to construct exact density-potential pairs from a homeoidal expansion