Added code to support view modes for image and video