move out root logic into gm-resizer and incorporate file validator