Fixed a bug in imaging.rb