throws exception if gd is not enabled when creating a png file.