Implemented gallery json code generation