Remove unnecessary dependence on arraytoimage.