Fix minor issues related to CUDA_KERNEL_LOOP

Remove "if (index < n)"-type comments that no longer apply due to CUDA_KERNEL_LOOP (as noted by @jamt9000 in #239) and use CUDA_KERNEL_LOOP in padding layer.

Also fix a few remaining lint errors from images_layer -- as of this PR, dev is lint clean.