traq is correct. Just to add my perspective on this, there are at least two important things to consider as regards the number of images:
- Byte load for the page - You don't want to have so many images that your page is slow to load and/or respond. This includes not only the aggregate byte load of the page (including images), but also the byte load of each individual image. Ideally all images for the web should be optimized for the lowest possible byte size that still exhibits acceptable resolution.
- Errors - The more images you include, the more likely you will make a typo or include a corrupt image that may break the script. But, if everything is done properly, there is no actual limit to the number of images. One should however consider the ramifications of the concepts mentioned in #1, possibly others.
And, as traq mentioned, if you want more help:
Please post a link to a page on your site that contains the problematic code so we can check it out.