Fix PHP5.3 compatibility

Remove use of anonymous array subscripting
Fix a bug in custom thumbnails