As long as you have some other way to determine what the alt tag's value should be, then sure. Without knowing what you really mean by "unique" alt tags, I can't really suggest anything off-hand (uniqid()? md5() hash of the file name? The current UNIX timestamp concatenated with the phase of the moon? )
PS: an empty string is a valid value for an alt tag, if you don't really have anything in mind for it and just want your HTML to be valid.