Ensure valid image formats only