Corrected image to array conversion