Fixed issue with 0-indexed images.