Make TV-L1 rescaling flexible and add median filtering [with GPU and test updates]

This is an extended version of https://github.com/Itseez/opencv/pull/693

I used original commit and updated GPU implementation and test data. 
Now test on buildbot must pass.