remove magic number

set the max number of images to a var.