Fixed thumbnail template tag treating provided sizes as strings, not integers

Fixed thumbnail template tag treating provided sizes as strings, not integers.

This closes #217.

I did not add the regression test because the only available media file is 512x512 lenna.png, which can not be used to demonstrate the problem (a portrait or landscape image is required). I can add the test if you are okay if I replace lenna.png with a different image, or simply crop it to be, say, 384x512, or make a 1024x512 sprite of two Lennas.