fix pixel scaling and datatype