Enabled debugging and fixed the Notify command for it
Updated capture image routine to not return an undefined error and only wait for known events
Removed a large amount of code that I don't need
Reformatted code