Fixed possible write of unallocated memory

If we modify the png in memory at all (with call to `png_set_gray_to_rgb` for instance), we need to call `png_read_update_info` otherwise `png_get_rowbytes` will return the wrong row size causing buffer overrun.