Refactor for activerecord
Create add/edit/delete for gallery and image