made ability to pass in raw imagedata a bit safer