stability updates

1. improved error handling
2. better way of locating gallery var directory - VARPATH rather than APPPATH
3. handles album names with funny characters which were urlencoded (e.g. open and close brackets)