Fix bugs on <upload> field for galleries