added validations to ensure only images can be uploaded