imagecache: migrate configuration to new API

I started to do this as there was a possible issue with imagecache as a result
of updates. However this has thus far not been proved, but still a useful
update. Hopefully not too broken!
webui: remove old redundant code