$filename = (undef, undef, $images[$n]->{imagename}) = (File::Spec->splitpath( $_, 0 ));