unified image conversion (resize, b/w and inversion)