initializing imagecounter