Tobias is right. There is no "if" ("There is no spoon")
If you want to switch more than two images, you may want to have a look at the swich-case constructor.
We used this in a very similar case, but i don't have access to the template code at the moment. Don't forget the fallback/default case, if you use "switch".