fix bug in subsample dims calc, add subsample test

Conflicts:
	python/test/test_images.py
fix and add test for images subtract method

Conflicts:
	python/test/test_images.py