Generate gallery model and controller