Change nicesize() to $modx->nicesize()