fixed: middle lines not flipped in image with even dimensions
moved convolution to own methods