Minor code cleanup

- Remove `index` parameter from `datauri()` as it's no longer used
- Store `filepath` as variable in `datauri()`