modified gallery to be comprehensive when used with different module