Hi Magnus,
There was a lot, lot more going on in your site than you indicated ;-)
After making a backup, drag, drop, and import the attached.
I've changed your image state tiddler to a regular tiddler and reference it's fields instead of using it as a data dictionary. You can change this if you want later, but you will have to make an action-setfield for every index you want to create, whereas doing it my way you only need one.
Part of the problem was that you were trying to do two things with one Button. You were trying to launch a modal, and you were trying to set (I think) field indexes. You were also trying to do all that with a single string. Not sure if that's possible but it was an interesting approach To do two things at once, you need to use the "actions" attribute. The action-setfield widget will let you set multiple fields at once with one widget, so that's what I used. But it won't let you set multiple indexes in a data dictionary at once.
I've turned off your old macro for now, but you can change things later if you want.
Have fun
-- Mark