tweaks + bug fixing

- narrowed premissions
- get rid of sepia filter for better performance
- improved document valid check
- other, minor performance improvements