Refactor determination of video height and width