if your images are (sequentially) numbered, you could abuse a hidden feature with VideoCapture, just pass it a (format) string:
VideoCapture cap("/my/folder/p%05d.jpg"); // would work with: "/my/folder/p00013.jpg", etc
while( cap.isOpened() )
{
Mat img;
cap.read(img);
// process(img);
}