swscale: Convert the check check_image_pointers helper to a macro