CHANGED:prepared the valid foreground/background file result for addImages function