switch to dealing strictly with imagedata