add period flag to imageloop