Create convertimagetomatrix