Add support for different aspect ratios/Fix crash caused by using reserved keyword class without quotes

This PR patches the following issues:
- Add support for different aspect ratios of thumbnail and full-size image
- Fix crash caused by using the reserved keyword class without quotes. This causes a crash/error and stops any further js execution at least in IE8 (although IE8 does not support transforms, this bug needs to be fixed, other versions/browsers may be affected as well.)