diff --git a/plugins/ImageGraph/ImageGraph.php b/plugins/ImageGraph/ImageGraph.php
index 64213b46de17e46a9d9eb0d2d316ab1723508693..c32325344a93232e12571d3c26e4aac2274b51a8 100644
--- a/plugins/ImageGraph/ImageGraph.php
+++ b/plugins/ImageGraph/ImageGraph.php
@@ -128,6 +128,13 @@ class Piwik_ImageGraph extends Piwik_Plugin
 				$parameters['date'] = $dateForSinglePeriodGraph;
 			}
 			
+			// add the idSubtable if it exists
+			$idSubtable = Piwik_Common::getRequestVar('idSubtable', false);
+			if ($idSubtable !== false)
+			{
+				$parameters['idSubtable'] = $idSubtable;
+			}
+			
 			$report['imageGraphUrl'] = $urlPrefix . Piwik_Url::getQueryStringFromParameters($parameters);
 		}
 			
diff --git a/tests/integration/expected/test_OneVisitorTwoVisits__subtable__API.getProcessedReport_week.xml b/tests/integration/expected/test_OneVisitorTwoVisits__subtable__API.getProcessedReport_week.xml
index d3ae531063296d6a6e0d5d93e24eac673f6dcda4..72398027cbe891bf85bc0fb4a95bffc3fa6b3981 100755
--- a/tests/integration/expected/test_OneVisitorTwoVisits__subtable__API.getProcessedReport_week.xml
+++ b/tests/integration/expected/test_OneVisitorTwoVisits__subtable__API.getProcessedReport_week.xml
@@ -26,7 +26,7 @@
 		</metricsDocumentation>
 		<documentation>This report contains information about the page URLs that have been visited. &lt;br /&gt; The table is organized hierarchically, the URLs are displayed as a folder structure.&lt;br /&gt;Use the plus and minus icons on the left to navigate.</documentation>
 		<actionToLoadSubTables>getPageUrls</actionToLoadSubTables>
-		<imageGraphUrl>index.php?module=API&amp;method=ImageGraph.get&amp;idSite=1&amp;apiModule=Actions&amp;apiAction=getPageUrls&amp;period=week&amp;date=2010-03-06</imageGraphUrl>
+		<imageGraphUrl>index.php?module=API&amp;method=ImageGraph.get&amp;idSite=1&amp;apiModule=Actions&amp;apiAction=getPageUrls&amp;period=week&amp;date=2010-03-06&amp;idSubtable=1650</imageGraphUrl>
 		<uniqueId>Actions_getPageUrls</uniqueId>
 
 	</metadata>
diff --git a/tests/integration/expected/test_twoVisitsWithCustomVariables__subtable__API.getProcessedReport_day.xml b/tests/integration/expected/test_twoVisitsWithCustomVariables__subtable__API.getProcessedReport_day.xml
index 31eef13c8567901d70a43e27118568a1271e3f8d..873e322d9a0ed0a6eb38bb8a9cc69f0739ec5cbd 100755
--- a/tests/integration/expected/test_twoVisitsWithCustomVariables__subtable__API.getProcessedReport_day.xml
+++ b/tests/integration/expected/test_twoVisitsWithCustomVariables__subtable__API.getProcessedReport_day.xml
@@ -36,7 +36,7 @@
 			<exit_rate>The percentage of visits that left the website after viewing this page.</exit_rate>
 
 		</metricsDocumentation>
-		<imageGraphUrl>index.php?module=API&amp;method=ImageGraph.get&amp;idSite=1&amp;apiModule=CustomVariables&amp;apiAction=getCustomVariablesValuesFromNameId&amp;period=day&amp;date=2010-01-03</imageGraphUrl>
+		<imageGraphUrl>index.php?module=API&amp;method=ImageGraph.get&amp;idSite=1&amp;apiModule=CustomVariables&amp;apiAction=getCustomVariablesValuesFromNameId&amp;period=day&amp;date=2010-01-03&amp;idSubtable=8</imageGraphUrl>
 		<uniqueId>CustomVariables_getCustomVariablesValuesFromNameId</uniqueId>
 
 	</metadata>