Capture img and videos in html dom with javascript.