fix the order issue of index gallery control block
merge Hexcles's commits