Moved tmp dir from /tmp to site directory
Proper template configuration
Created nimg module and moved files
Code cleanup