New motion script for picamera