If your number of options is known, then you can create a container style for each scenario.
.five-col .col {
float: left;
width: 20%;
}
And structure your html as...
<ul class="five-col">
<li class="col"> image </li>
...
</ul>
Create a new container style for each column layout, eg. .four-col
.eight-col
and just toggle between them.
This does require you to know ahead of time the number of columns you will allow them to choose between, but an 'n' solution might allow the user to create something silly like 20+ columns so vetting the options ahead of time has it's advantages.
If you are interested in a framework that gives you something similar, check out http://unsemantic.com/ or http://960.gs/.