Fix PHP warning: invalid argument for foreach, when cache dir is empty and argument is bool:false
Make code more readable.
Reindent codestyle.
Merge pull request #11 from sim2github/master

Fix PHP warning: invalid argument for foreach in comment and photo