patch_bmp bugfixes

1. Changed how the new width and height is calculated.
2. Scanline alignment buffering is not necessarily 0.
Merge pull request #4 from aqrit/master

patch_bmp bugfixes