remove some bugs when RPi camera module is used (not completely yet)