algorithm for sending image over uart in chunks