I am building a photo gallery that displays images in rows of four after running them through a small resizing function. After the fourth image I get an error saying:
An exception occurred while trying to read the image.
javax.imageio.IIOException: Invalid icc profile: duplicate sequence numbers
I have no idea what the icc profile is so someone please help.

<cfdirectory action="list" directory="#localphotodir#" name="PhotoDirectory" listinfo="all" type="file" recurse="no">
<cfinclude template="/common/incl_nav.cfm">
<cfdump var="#PhotoDirectory#" expand="no">

<table cellpadding="3" cellspacing="3" border="0" align="center">
		<th colspan="4"><cfoutput>#listFirst(url.folder,"_")#'s Photos</cfoutput></th>
			<cfset col = 1>
			<cfoutput query="PhotoDirectory">
				<cfif col MOD 4 EQ 1>
		  <tr align="center">
		  <cfset col = 1>
			IMGPath = photopath & listFirst(url.folder,"\") & "/" & photodirectory.name;
			Thumb = ImageNew(IMGPath);
		  <cfdump var="#imgpath#">
		  <td align="center">
			<cfimage source="#thumb#" action="writetobrowser">
		  <cfset col = col + 1>
		  <cfdump var="#col#">
		 <cfif col MOD 4 EQ 1>

Also here is a simpler one:
I want to split the cfdirectory query into groups of 10 so tat I can display only ten on each page. Does anyone know how to do that. Use the same code as above for the example.