change int to size_t in case of overflow

Signed-off-by: ezheng <ezheng@cs.unc.edu>
fix a bug when the number of threads in a cuda block is bigger than 32. Simply added __syncthreads() in the function readImageIntoSharedMemory(). If the number of threads is less than a warp, __syncthreads() is not needed

Signed-off-by: ezheng <ezheng@cs.unc.edu>