Only build when no media variant is set, and display variant isn't legacy

Change-Id: I48e12532aa15f3233df9551a1603bcb4fd7b5ade