I had the same problem when doing a fresh install some hours ago and after some tests I have found where the problem is. It seems that the problem appears only if short open tags is disabled in PHP configuration. So the problem can be solved in two different ways:
Enable short open tags in php config (easy if you have access to php.ini on the server).
Change the first line from <? to <?php in both index.php and thumbnailer.php