maybe try changing this line:
[php]echo(getCachedResizedImageHTML(ob_get_clean(), "assets/gallery/".$row_rsGalleries['ID']."/", "crop", "", false));[php]
to:
echo(getCachedResizedImageHTML(ob_get_clean(), "assets/gallery/".($row_rsGalleries['ID']), "crop", "", false));
also what is your php server version?
and can you send a link where i can see the problem.