fix horizontal and vertical resolution of thumbnail.
make sure frame writing doesn't wrap around.