Change base image when attribute is selected on catalog page

I want to change the base image depending on the color which is selected. So if i select “Olive Green”, all the products with olive color single products must change the base images to the black version.

So, this is the standard catalog page: So, this is the standard catalog page:

I change the color with the color swatch: I change the color with the color swatch

If i change the color to Olive Green, i see this: If i want to change the color to Olive Green, i see this:

But i want to see this: enter image description here

All the single products do have their own image. How to do this?