change jpg to jpeg for images. fixed bug with video