- start rewrite of gallery plugin