Add as_image_get_alpha_flags()

We'll use this to detect funky images in the validator.
Use as_image_get_alpha_flags() when validating and building metadata