Pass in a maximum size for image comparisons, to prevent allocating insane amounts of memory.