Fixed code for new template api.
Add raw and resize options.
Use new API.
Use new API.
Merge branch 'develop'