Added optimizations to makefile and optional image capture