Bugfix: Forgot to initialize the image counter