/**
	* The constructor function which takes in an SQL query (or defaults to a select all from database) and calls the rewind() function to prep for looping
	*
	* @param string $sql (Optional) The SQL query used to retrieve product image rows from the database. If not used all rows will be selected from the database
	* @return ISC_PRODUCT_IMAGE_ITERATOR
	*/

	public function __construct($sql='')
	{
		if(empty($sql)) {
			$this->sql = ISC_PRODUCT_IMAGE::generateGetAllProductImagesFromDatabaseSql();
		} else {
			$this->sql = $sql;
		}

		$this->db = &$GLOBALS['ISC_CLASS_DB'];
		$this->rewind();
	}