Fix a bug when removing a theme

I was counting upwards in a loop that started on the last element :)
This worked as long as the link to remove was the last one, but caused the browser to hang otherwise.
This could be reproduced by reloading the page while in dark theme. Firefox would keep the checkbox checked, but the theme wouldn't have been loaded. (This still needs to be fixed; it just doesn't crash the browser now.)