added check for CLEAR_IMAGE