added 2 methods to check file existence and form related image paths