Correct mp_add_handler() & test write_jpg_mem()