main function removed into image.cpp