Added ability to switch between video or image, and added optimization.