replaced scipy.misc.imresize with small custom resizer