Fixed a bug in filelists and imagelists that caused a js exception + some editcontent refactoring