Refactor getting fileType into its own separate function in Photo service