fixed possible segmentation faults; tested png loading