Added forward backward test.
Distinguish between 2d and 3d images.
Adapted 2d test case.