changes to make derived variable for both image and grid working, more tests