Fix graph tags test on freebsd

This is an update of #5437 and removes changing the dir permissions from 0600 to 0700.  It just includes setting the gid and uid in the tests. 

I remove the dir permission change because it's a very risky change that will touch every image and most of these tests and functions need to be run as root anyways. 

This had one prior LGTM so I'm merging this to keep things moving. 

Closes #5437