Upload avatar for resources. Validation and some fixes.