fixed bug in processHDF5 in malloc(size*(char*))

also fixed a missing png_destroy struct in write_png.c