"They were then sent back to Indonesia through Batam and are now in the custody of Riau provincial police," Iqbal said on Wednesday, as quoted by Xinhua news agency.
He added that, following an investigation, Malaysian authorities concluded that the images were unintentionally saved.
In the past several years the terrorist threat levels in Indonesia increased as local militant groups swore allegiance to the Daesh terrorist group, outlawed in Russia and other countries.
Indonesia and Malaysia are the two most-populated Muslim-majority countries in Southeast Asia.
Never miss a story again — sign up to our Telegram channel and we'll keep you up to speed!