Convert Gallery to M.Class