On demand thumbnail generator for PHP 5.3