Engineering the spatial confinement of exciton-polaritons in semiconductors