fixed off-by-one that caused image corruption when fetching images > 4096 bytes