Fix bug #27 in in-place vflip and hflip

This fixes #27 which made a terrible output when doing in-place hflip or vflip. Sorry for the bug, thanks to @jonathantompson for spotting it, and to@soumith for pinging me.