Refactor 'else ' conditional in WRITE_4PIXELS functions