Make php5.4.4 complain less

Some simple fixups to make it display images using the image viewer and not generate errors when run in php5.4.4.