Testing for membership level

I’m wanting to display a different jpg for each different level of membership so for example a stranger would see a different message to a basic member.

Stranger told to register

Basic member told to upgrade to premium.

What is the best way of do this?

Regards

David