You will need an install script. To get is set up, have a look at this:
Adding an Install/Uninstall/Update script file
You can remove all the functions but keep the install function. Your final install function should look like this:
function install($parent) {
jimport('joomla.filesystem.folder');
jimport('joomla.filesystem.file');
if(!JFolder::exists(JPATH_ROOT . '/media/images/example/photos')) {
$path = JPATH_SITE . '/media/images';
$folder = 'example/photos';
JFolder::create( $path .'/'. $folder, 0755 );
}
}
Hope this helps