Add validation to allow only jpg and png images.