Views + SQL for gallery edit and new