Refactor ccl_context_get_supported_image_formats()
due to problems specified in previous commit.