Separate convert_sixel into 3 functions