When an image matrix is passed as an argument it gives the above error, but when reading images directly from file it compiles smoothly.
exp_folder = \'examples\'