Added directory argument to upload image method in upload factory. Updated page factory with argument.