Added some functions to deal with image processing in video mode