preparing some global states
cleaning images