logic for video post and image posts