Fix issues in imagemanager

XSS issue reported by Manuel Garcia Cardenas
Broken categories list
Some PSR-2 formatting cleanup
Some cleanup of session code

Use PHP management of session cookie when a custom session_name is specifed.  Remove function_exists checks for session_cache_expire since all supported PHP versions will have it.
Merge pull request #100 from geekwright/master

Fixes for session and imagemanger issues